Possible BUG: Default zip for Windows debug build is pythonXY_d.zip

A

Adal Chiriliuc

Hi.

I think there's a bug in the code which builds sys.path for Windows.
The default zip archive file name in the debug build of Python is
pythonXY_d.zip and not pythonXY.zip. I'm not sure if this is
intentional. The zip import PEP doesn't mention it, nor does it the
code implementing it (PC/getpathp.c)

You can see that on Unix the zip archive name does not depend on the
type of build (or so it says in the PEP below).

If it's a bug it's caused by the fact that the name of the Python DLL
is used and that that name includes _d in the debug build.

PEP 273:
We add one name to sys.path. On Unix, the directory is
sys.prefix + "/lib", and the file name is
"python%s%s.zip" % (sys.version[0], sys.version[2]).
So for Python 2.2 and prefix /usr/local, the path
/usr/local/lib/python2.2/ is already on sys.path, and
/usr/local/lib/python22.zip would be added.
On Windows, the file is the full path to python22.dll, with
"dll" replaced by "zip". The zip archive name is always inserted
as the second item in sys.path. The first is the directory of the
main.py (thanks Tim).

Regards,
Adal Chiriliuc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top