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

Adal Chiriliuc no at mail.com
Wed Jul 28 23:42:59 CEST 2004


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




More information about the Python-list mailing list