Re: [Distutils] Pypy and site.py and makepath

At 06:32 PM 3/13/2010 +0100, Lennart Regebro wrote:
On Sat, Mar 13, 2010 at 18:25, P.J. Eby <pje@telecommunity.com> wrote:
Actually, I suddenly remembered -v, and ran python -v. and the local site.py is *not* being imported, which explains why no matter what I write in it it gets ignored. So there seems to be at least two differences here.
Perhaps PyPy also has an optimization that makes it use a built-in version of site.py, instead of using standard import logic. Finding that would be a bit harder than tracking down the imp problem, though, as it doesn't appear that site is a "builtin" in PyPy the way imp is. It does appear to be imported by http://codespeak.net/pypy/dist/pypy/bin/py.py however.
(I'm assuming, btw, that by "local site.py" you mean the patching site.py, not a site.py located in say, PyPy's site-packages directory.)
Right, I mean the one in the Distribute root. When starting pypy in the distribute directory, it will load the site.py, and try to "imp.load_module('site',stream,path,descr)". As you meantion, that doesn't actually seem to do anything.
When starting CPython in the distribute directory, the local site.py is ignored.
Interesting; that seems like an odd point of difference. Perhaps the '' is added to sys.path later in CPython than it is in PyPy. (In any case, that 'site.py in the Distribute root' (aka setuptools' site-patch.py) is only intended to be executed when it's in a PYTHONPATH directory.)

On Sat, Mar 13, 2010 at 20:22, P.J. Eby <pje@telecommunity.com> wrote:
(In any case, that 'site.py in the Distribute root' (aka setuptools' site-patch.py) is only intended to be executed when it's in a PYTHONPATH directory.)
I reported that as a bug in PyPy, and also mentioned the False keyword default on chat. They were already targetting distribute/setuptools for the next release. The next problem encountered in the tests is that PyPy of course have no support for compiling C-extensions, so we'll need to add conditionals for that I guess. But that's for some other day. :) -- Lennart Regebro: Python, Zope, Plone, Grok http://regebro.wordpress.com/ +33 661 58 14 64
participants (2)
-
Lennart Regebro
-
P.J. Eby