Wednesday, 18 September 2013

Python regex - Spurious SystemError 'bad argument to internal function'

Python regex - Spurious SystemError 'bad argument to internal function'

I'm on 32 bit Python 2.7.3 and Windows 7. I am working on a complex
application which uses COM to communicate with other processes.
My application uses regular expressions in a few (but not very many)
places. Very frustratingly, I spuriously get errors of the following form:
Traceback (most recent call last):
...
File "re.pyc", line 137, in match
SystemError: ..\Objects\weakrefobject.c:903: bad argument to internal
function
The errors are not reproducible and seem to occur randomly. What's more,
they occur in any of the places where I use re.match. To me, this seems
very much like a Python bug.
Has anybody else encountered this behaviour, and knows how to fix it?

No comments:

Post a Comment