By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,199 Members | 1,125 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,199 IT Pros & Developers. It's quick & easy.

Python25.zip

P: n/a
As part of the Python initialization, C:\Windows\System32\Python25.zip
is set up in the path.

I haven't seen any documentation on the use or purpose of the zip file.

Colin W.

Nov 30 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Dennis Lee Bieber wrote:
On Thu, 30 Nov 2006 18:14:11 -0500, "Colin J. Williams"
<cj*@sympatico.cadeclaimed the following in comp.lang.python:
>As part of the Python initialization, C:\Windows\System32\Python25.zip
is set up in the path.

I haven't seen any documentation on the use or purpose of the zip file.
Well, did you examine the contents of it?
There is no such file in C:\Windows\System32 - Python 2.5 on a Windows XP
>
I believe for some versions now, "import" can pull from a ZIP
archive -- perhaps they've put the many standard library imports into a
single file...
Yes, since 2.3 - thanks to Fredrick for the pointer to PEP 273. That
gives the helpful warning that the above should follow the home
directory in the path list.

PEP 302 says "[PYTHONPATH] is directly needed for Zip imports."

The role of Python25.zip is not clear. Is it required in the path just
to enable the import X.zip capability?

Colin W.

Dec 1 '06 #2

P: n/a
Colin J. Williams wrote:
Dennis Lee Bieber wrote:
>On Thu, 30 Nov 2006 18:14:11 -0500, "Colin J. Williams"
<cj*@sympatico.cadeclaimed the following in comp.lang.python:
>>As part of the Python initialization, C:\Windows\System32\Python25.zip
is set up in the path.

I haven't seen any documentation on the use or purpose of the zip file.
Well, did you examine the contents of it?
There is no such file in C:\Windows\System32 - Python 2.5 on a Windows XP
>>
I believe for some versions now, "import" can pull from a ZIP
archive -- perhaps they've put the many standard library imports into a
single file...
Yes, since 2.3 - thanks to Fredrick for the pointer to PEP 273. That
gives the helpful warning that the above should follow the home
directory in the path list.

PEP 302 says "[PYTHONPATH] is directly needed for Zip imports."

The role of Python25.zip is not clear. Is it required in the path just
to enable the import X.zip capability?
No. It's there just *in case* you have a Python25.zip lying around containing
the library. By default, it isn't.

Georg
Dec 2 '06 #3

P: n/a
Colin J. Williams schrieb:
The role of Python25.zip is not clear. Is it required in the path just
to enable the import X.zip capability?
To rephrase Georg's explanation: it allows Python distributors (e.g.
Linux distributors, or ActiveState) to put all of the Python library
(including site.py) into a single zip file, instead of requiring a
Lib directory with many files in it. E.g. on Windows, a complete
Python installation could consist of three files: python.exe,
python25.dll, and python25.zip.

To make that possible, you can't tell people that they have to edit
site.py to put a zip file on sys.path, instead, the distributed
interpreter must already look for a file even though this file
will usually not be present.

Regards,
Martin
Dec 2 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.