Issue 1534764: sys.path gets munged with certain directory structures (original) (raw)

Issue1534764

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:19 admin set github: 43777
2009-03-30 22:25:29 brett.cannon set status: open -> closedresolution: out of datemessages: +
2009-02-12 01:16:52 ajaksu2 set type: behaviormessages: + nosy: + ajaksu2stage: test needed
2009-02-11 03:07:38 ajaksu2 set assignee: brett.cannonnosy: + brett.cannon
2006-08-04 19:57:36 gustavotabares.historic create