2.3b1 sys.path anomaly on W2K

Just just at xs4all.nl
Thu May 1 11:02:44 EDT 2003


In article <3eb1331d$0$21313$afc38c87@>,
 "James C. Ahlstrom" <jim at interet.com> wrote:

> > Where does the 'C:\\WINNT\\System32\\python23.zip' come from in sys.path?
> > Does anyone else get this? Is it meant to be there?
> 
> It is the default zip file path.  It enables you to put modules in a zip
> file and have them imported.  A default path entry for zip files is
> necessary so the standard library can be imported from a zip archive.
> 
> Having said that, I don't think it is a good idea to leave the default zip
> file
> on sys.path if the file does not exist.  The original site.py had code which
> removed non-existent paths, and apparently that code was removed, or
> does not delete non-existent zip paths.

Maybe site.py can be made smarter, but the idea is that there may be 
items on sys.path that do not point to items on the file system (eg. 
URLs) yet can be handled by an importer later. IOW, the check was 
removed to generalize the idea that sys.path items are not _necessarily_ 
file system paths.

Just




More information about the Python-list mailing list