[ python-Bugs-1734860 ] sitecustomize.py not found

SourceForge.net noreply at sourceforge.net
Thu Jun 21 03:44:47 CEST 2007


Bugs item #1734860, was opened at 2007-06-11 06:33
Message generated for change (Comment added) made by gagenellina
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1734860&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Windows
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: www.spirito.de (openspirito)
Assigned to: Nobody/Anonymous (nobody)
Summary: sitecustomize.py not found

Initial Comment:
Under my configuration (Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32) the sitecustomize.py is not found in the current directory. I added some testing code into site.def execsitecustomize() and found out, that the current path is not part of sys.path, but later on in the main program it is.

----------------------------------------------------------------------

Comment By: Gabriel Genellina (gagenellina)
Date: 2007-06-20 22:44

Message:
Logged In: YES 
user_id=479790
Originator: NO

This is due to patch
<http://sourceforge.net/tracker/index.php?func=detail&aid=1232023&group_id=5470&atid=305470>
and is documented in the NEWS.txt file for 2.5:

- Patch #1232023: Stop including current directory in search
  path on Windows.


----------------------------------------------------------------------

Comment By: www.spirito.de (openspirito)
Date: 2007-06-14 05:53

Message:
Logged In: YES 
user_id=1103348
Originator: YES

It worked like this in all previous versions of Python. I think it is very
useful e.g. if you work with development versions of other libraries.
Better than adding import paths via sys.path += ['abc'] at the top of
Python scripts. Or is there another or better way to add project specific
import paths?

But at least there should be a notice in the documentation of Python 2.5
that this behaviour changed. I spend some time to find out that it was
changed.

----------------------------------------------------------------------

Comment By: Gabriel Genellina (gagenellina)
Date: 2007-06-14 04:43

Message:
Logged In: YES 
user_id=479790
Originator: NO

I don't think that allowing sitecustomize.py to be run from the current
directory would be a good idea, as it gets executed automatically on any
invocation of the Python program (and it could contain arbitrary code).

You can put sitecustomize.py inside Lib or Lib\site-packages and it will
be picked fine.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1734860&group_id=5470


More information about the Python-bugs-list mailing list