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: sys.path gets munged with certain directory structures
Type: behavior Stage: test needed
Components: Interpreter Core Versions:
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: ajaksu2, brett.cannon, gustabares
Priority: normal Keywords:

Created on 2006-08-04 19:57 by gustabares, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg60963 - (view) Author: Gustavo Tabares (gustabares) Date: 2006-08-04 19:57
Platform: Windows XP SP2
Python Version: 2.4.2 final

First off, I'm not sure if this is the same bug as
947380 . Comments say it was fixed in Python 2.4, but
I'm running Python 2.4.2 and it looks like I'm hitting
the same issue. If this is the same issue and has been
fixed in a later version, I apologize.

To reproduce:

1. Create a new directory (e.g., 'foo').
2. Inside foo, create a __init__.py along with a
directory called 'stat' which also has an empty
__init__.py inside of it.
3. 'cd' to this directory via the command line and
start the Python interpreter.

Observe the 'import site' failed error. A quick check
at sys.path reveals that sys.path is munged and doesn't
contain all that it should.

WORKAROUND: Rename 'stat' directory to 'stats' or
something else.

msg81701 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2009-02-12 01:16
Reproduced on trunk, needed unsetting PYTHONPATH. A test case with
os.mkdir, chdir, etc. would be great.
msg84686 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2009-03-30 22:25
I can't reproduce this. Closing as out of date. Plus having an import
fail because you shadow a built-in is not a bug.
History
Date User Action Args
2022-04-11 14:56:19adminsetgithub: 43777
2009-03-30 22:25:29brett.cannonsetstatus: open -> closed
resolution: out of date
messages: + msg84686
2009-02-12 01:16:52ajaksu2settype: behavior
messages: + msg81701
nosy: + ajaksu2
stage: test needed
2009-02-11 03:07:38ajaksu2setassignee: brett.cannon
nosy: + brett.cannon
2006-08-04 19:57:36gustavotabares.historiccreate