This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: 2.3a2 site.py non-existing dirs
Type: Stage:
Components: None Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: jvr Nosy List: brett.cannon, jrut, jvr, nnorwitz
Priority: normal Keywords:

Created on 2003-02-25 22:44 by jrut, last changed 2022-04-10 16:07 by admin. This issue is now closed.

Messages (11)
msg14841 - (view) Author: James P Rutledge (jrut) Date: 2003-02-25 22:44
In Python 2.3a2 the site.py leaves non-existing
directories in sys.path.

On my Debian Linux system, using Python 2.3a2,
the sys.path, after site.py is executed during
interpreter initialization, includes the entry

   /usr/local/lib/python23.zip

although no such directory currently exists on
my system.

The module documentation contained in site.py does
state

  "Non-existing directories (or non-directories)
  are never added to sys.path"
msg14842 - (view) Author: James P Rutledge (jrut) Date: 2003-02-26 02:56
Logged In: YES 
user_id=720847

Additional info -- the site.py used in
Python 2.2.2 explicitly removes non-existing
and non-directory files from sys.path.

The Python 2.3 site.py does not have that
feature.
msg14843 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-02-26 03:08
Logged In: YES 
user_id=33168

Just, does the doc still need to be updated?
msg14844 - (view) Author: Just van Rossum (jvr) * (Python triager) Date: 2003-02-26 08:43
Logged In: YES 
user_id=92689

The docs are indeed wrong.
msg14845 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-05-29 01:33
Logged In: YES 
user_id=357491

I take it the docs are what needs to change and not site.py?
msg14846 - (view) Author: James P Rutledge (jrut) Date: 2003-05-29 19:20
Logged In: YES 
user_id=720847

I do not know what policy is desired for the condition of
the path after executing site.py.

I found the problem when I switched to try 2.3 and used an
application I wrote which searches the path to obtain
information about installed  modules.  During
troubleshooting, the change in site.py from 2.2 to 2.3, to
stop removing non-existent directories in the path, became
evident as the reason for the application finding a
non-existent directory in the path.

The application was, of course, easily changed to skip
non-existent directories.  The question is whether removing
of non-existent directories in the path _should_ be done by
site.py
msg14847 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-07-08 04:11
Logged In: YES 
user_id=357491

Can someone with more experience with the "official" policy of of 
site.py say whether or not the docs should be changed or site.py 
itself?
msg14848 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2004-03-20 21:42
Logged In: YES 
user_id=357491

In Python 2.4, rev. 1.59 has site.py remove non-existing paths.
msg14849 - (view) Author: Just van Rossum (jvr) * (Python triager) Date: 2004-03-21 07:49
Logged In: YES 
user_id=92689

As I wrote before, the _docs_ are wrong, site.py should NOT 
remove non-existing elements, since they may be non-file 
system items to be handled by a custom importer.
msg14850 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2004-03-21 14:33
Logged In: YES 
user_id=357491

OK, the change was backed out.
msg14851 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2004-08-07 19:42
Logged In: YES 
user_id=357491

Closing this as "won't fix" since the part of the docs in question apply 
only to .pth files and not directories already in sys.path.
History
Date User Action Args
2022-04-10 16:07:08adminsetgithub: 38053
2003-02-25 22:44:39jrutcreate