[issue3279] import of site.py fails on startup

2008-09-05 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Fixed in r66239. -- resolution: accepted -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue3279] import of site.py fails on startup

2008-09-05 Thread Alexandre Vassalotti
Alexandre Vassalotti <[EMAIL PROTECTED]> added the comment: Look good to me, and python-dev accepted the patch. So, go ahead and commit it. -- assignee: -> benjamin.peterson resolution: -> accepted ___ Python tracker <[EMAIL PROTECTED]>

[issue3279] import of site.py fails on startup

2008-09-05 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Yes, indeed. Added file: http://bugs.python.org/file11402/make_modules_builtin2.patch ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue3279] import of site.py fails on startup

2008-09-05 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: > Windows build files will need to be updated Nothing to do here: they are already built-in, linked into Python30.dll, and listed in PC/config.c But shouldn't the two extension modules be removed from setup.py?

[issue3279] import of site.py fails on startup

2008-09-05 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Here's a patch that builds _bytesio and _stringio right into the binary. I think Windows build files will need to be updated, though. -- keywords: +needs review Added file: http://bugs.python.org/file11400/make_modules_builtin.patc

[issue3279] import of site.py fails on startup

2008-09-05 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: IMO, it's unacceptable to be running Python code before the stdio streams are set up. I believe that moving the site initialization after the setting up the streams isn't as big a problem because the dynlibs are on sys.path before site is r

[issue3279] import of site.py fails on startup

2008-09-03 Thread Benjamin Peterson
Changes by Benjamin Peterson <[EMAIL PROTECTED]>: -- priority: release blocker -> deferred blocker ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue3279] import of site.py fails on startup

2008-08-25 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: On Mon, Aug 25, 2008 at 10:49 AM, Benjamin Peterson <[EMAIL PROTECTED]> wrote: > > Benjamin Peterson <[EMAIL PROTECTED]> added the comment: > > On Mon, Aug 25, 2008 at 12:48 PM, Brett Cannon <[EMAIL PROTECTED]> wrote: >> >> Brett Cannon <[EMAIL

[issue3279] import of site.py fails on startup

2008-08-25 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: On Mon, Aug 25, 2008 at 12:48 PM, Brett Cannon <[EMAIL PROTECTED]> wrote: > > Brett Cannon <[EMAIL PROTECTED]> added the comment: > > On Mon, Aug 25, 2008 at 6:40 AM, Benjamin Peterson > <[EMAIL PROTECTED]> wrote: >> >> Benjamin Peterson <[

[issue3279] import of site.py fails on startup

2008-08-25 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: On Mon, Aug 25, 2008 at 6:40 AM, Benjamin Peterson <[EMAIL PROTECTED]> wrote: > > Benjamin Peterson <[EMAIL PROTECTED]> added the comment: > > We could: > > 1. Use _fileio._FileIO directly. > 2. Use os.open. > 3. Initialize the stdio streams bef

[issue3279] import of site.py fails on startup

2008-08-25 Thread Alexandre Vassalotti
Alexandre Vassalotti <[EMAIL PROTECTED]> added the comment: Benjamin is right. site.py imports the io module before _bytesio and _stringio are available for import. Thus the python version of BytesIO and StringIO is always used. There is an old thread about the issue at http://mail.python.org/pip

[issue3279] import of site.py fails on startup

2008-08-25 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: It was probably done so that importing _bytesio would actually work in io. IMO, it would be better to just compile _bytesio and _stringio into the python binary. ___ Python tracker <[EMAIL PROTECTED]>

[issue3279] import of site.py fails on startup

2008-08-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: Well, it would be interesting to know why r62778 has exactly the opposite move. Alexandre, do you remember doing it? -- nosy: +alexandre.vassalotti ___ Python tracker <[EMAIL PROTECTED]>

[issue3279] import of site.py fails on startup

2008-08-25 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Here's my patch for the problem. Added file: http://bugs.python.org/file11247/different_order.patch ___ Python tracker <[EMAIL PROTECTED]>

[issue3279] import of site.py fails on startup

2008-08-25 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: We could: 1. Use _fileio._FileIO directly. 2. Use os.open. 3. Initialize the stdio streams before importing site. This seems like the best option, although I haven't run all the tests yet. -- nosy: +benjamin.peterson

[issue3279] import of site.py fails on startup

2008-08-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: Attached patch writes the "'import site' failed" message to libc stderr instead of sys.stderr, which does not exist at this point. The initial problem still remains: site.py cannot use the "open" builtin. -- keywords: +patch Ad

[issue3279] import of site.py fails on startup

2008-08-21 Thread Benjamin Peterson
Changes by Benjamin Peterson <[EMAIL PROTECTED]>: -- priority: critical -> release blocker ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue3279] import of site.py fails on startup

2008-07-04 Thread Brett Cannon
Changes by Brett Cannon <[EMAIL PROTECTED]>: -- nosy: +brett.cannon ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mail

[issue3279] import of site.py fails on startup

2008-07-04 Thread Georg Brandl
Changes by Georg Brandl <[EMAIL PROTECTED]>: -- priority: -> critical ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list m

[issue3279] import of site.py fails on startup

2008-07-04 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: This happens if the site-packages directory contains a .pth file. This was unnoticed because the usual message 'import site' failed; use -v for traceback is never printed: sys.stderr is empty before the call to initstdio().

[issue3279] import of site.py fails on startup

2008-07-03 Thread Roger Upole
New submission from Roger Upole <[EMAIL PROTECTED]>: In pythonrun.c, initstdio injects 'open' into builtins. However, initsite is called before initstdio and site.py uses open. Running with -v, this traceback is printed: Traceback (most recent call last): File "j:\python30\lib\site.py", line