Author samueljohn
Recipients ezio.melotti, mrabarnett, samueljohn
Date 2013-05-24.17:40:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1369417243.06.0.993082490408.issue18050@psf.upfronthosting.co.za>
In-reply-to
Content
As also discussed at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=704084 and https://github.com/mxcl/homebrew/pull/19300, Python 2.7.4 and 2.7.5 seem to have added an `from _sre import MAXREPEAT` to the sre_compile.py, sre_parse.py and sre_constants.py modules.

But python 2.7.3 (and older?) don't have the built in MAXREPEAT in _sre. Some virtualenvs have to be updated (which is easy) but some Software (such as vim, shipped with OS X 10.8.3) is statically linked to an older python 2.7.2 (I guess) but somehow picks up my newly built python 2.7.5 and attempts to load it's site.py. (Weechat also reported to being affected)

I think this is more a bug of vim/weechat etc. but we at homebrew have to do some "hacky" fix, because Apple is not going to update vim very soon, and so having a newer python in path breaks system stuff.

So I am fine if you close this here again. But at least we have a reference or perhaps you guys have a better idea how to work-around.

For homebrew, I propose a monkey-patch in re.py to the _sre module if it does not have a MAXREPEAT.


   try:
       from _sre import MAXREPEAT
   except ImportError:
       import _sre
       _sre.MAXREPEAT = 65535 # this monkey-patches all other places of "from _sre import MAXREPEAT"
History
Date User Action Args
2013-05-24 17:40:43samueljohnsetrecipients: + samueljohn, ezio.melotti, mrabarnett
2013-05-24 17:40:43samueljohnsetmessageid: <1369417243.06.0.993082490408.issue18050@psf.upfronthosting.co.za>
2013-05-24 17:40:43samueljohnlinkissue18050 messages
2013-05-24 17:40:42samueljohncreate