[Pythonmac-SIG] RE: SRE errors with IDE, addendum
Damon Butler
Damon Butler <dbutler@impressions.com>
10 Jul 01 13:05:12 -0500
Hi, Just,
About a week ago you helped solve a problem with the MacPy IDE that =
involved my use of pre vs. the expected use of sre. A quick refresher...
<quote>
> TypeError: pcre_compile() argument 1 must be string without null bytes, =
not
> string
Ah, this seems due to the conversion from regex to re. Apparently, sre =
allows
null bytes in pattern strings, but pre doesnt :-(. As a workaround, you =
could
patch PyFontify:
import re
becomes:
import sre
re =3D sre
</quote>
The fix worked, in that the IDE would run (I used Python 2.0 syntax, =
however: "import sre as re"). But I did run across other errors related to =
same when accessing particular features of the IDE, most prominently the =
Module Browser.
Thought you might like to know that, for anyone else who wishes to use pre =
as a matter of course over the broken sre, the following modules also =
ought to be patched in a similar fashion:
- PyBrowser.py
- PyDocSearch.py
- PyEdit.py
WSocket.py also has a reference to "re" (which on my system will call up =
pre), but that doesn't appear to cause any problems.
Damon Butler
------------
Impressions Book and Journal Services, Inc.
(608)244-6218
dbutler@impressions.com