[Pythonmac-SIG] py2app crash if path contains a colon
Ronald Oussoren
ronaldoussoren at mac.com
Fri Jun 16 09:21:03 CEST 2006
On 15-jun-2006, at 23:21, Bob Ippolito wrote:
>
> On Jun 15, 2006, at 2:12 PM, Bob Ippolito wrote:
>
>> FWIW, this isn't at all Mac OS X specific..
>>
>> $ uname -rs && pwd && ./python -c "import sys; print sys.path"
>> FreeBSD 6.0-RELEASE
>> /usr/home/bob/src/python/:colon
>> 'import site' failed; use -v for traceback
>> ['', '/usr/local/lib/python25.zip', '/usr/home/bob/src/python/',
>> 'colon/../Lib/', '/usr/home/bob/src/python/', 'colon/../Lib/plat-
>> freebsd6', '/usr/home/bob/src/python/', 'colon/../Lib/lib-tk', '/usr/
>> home/bob/src/python/', 'colon/Modules']
>>
>> The issue is of course that all this code is happening in C and
>> expecting ':' as the delimiter. Modules/getpath.c probably should be
>> refactored to use PyObject* ASAP, rather than doing it last.
>
> Well, it looks like that's not such a good idea either, because
> Py_GetPath() is called before Python's fully initialized. Any
> exception would probably make the interpreter explode. Hmm :)
The most prudent thing to do right now is to file a bug at python's
SF tracker and let someone else worry about this ;-).
Wouldn't it be possible to set up the right sys.path in py2app's
application stub to work around this issue?
Ronald
More information about the Pythonmac-SIG
mailing list