Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sys.path gets munged with certain directory structures #43777

Closed
gustabares mannequin opened this issue Aug 4, 2006 · 3 comments
Closed

sys.path gets munged with certain directory structures #43777

gustabares mannequin opened this issue Aug 4, 2006 · 3 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@gustabares
Copy link
Mannequin

gustabares mannequin commented Aug 4, 2006

BPO 1534764
Nosy @brettcannon, @devdanzin

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/brettcannon'
closed_at = <Date 2009-03-30.22:25:29.736>
created_at = <Date 2006-08-04.19:57:36.000>
labels = ['interpreter-core', 'type-bug']
title = 'sys.path gets munged with certain directory structures'
updated_at = <Date 2009-03-30.22:25:29.734>
user = 'https://bugs.python.org/gustabares'

bugs.python.org fields:

activity = <Date 2009-03-30.22:25:29.734>
actor = 'brett.cannon'
assignee = 'brett.cannon'
closed = True
closed_date = <Date 2009-03-30.22:25:29.736>
closer = 'brett.cannon'
components = ['Interpreter Core']
creation = <Date 2006-08-04.19:57:36.000>
creator = 'gustabares'
dependencies = []
files = []
hgrepos = []
issue_num = 1534764
keywords = []
message_count = 3.0
messages = ['60963', '81701', '84686']
nosy_count = 3.0
nosy_names = ['brett.cannon', 'gustabares', 'ajaksu2']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'test needed'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue1534764'
versions = []

@gustabares
Copy link
Mannequin Author

gustabares mannequin commented Aug 4, 2006

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.

@gustavotabareshistoric gustavotabareshistoric mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Aug 4, 2006
@devdanzin devdanzin mannequin assigned brettcannon Feb 11, 2009
@devdanzin
Copy link
Mannequin

devdanzin mannequin commented Feb 12, 2009

Reproduced on trunk, needed unsetting PYTHONPATH. A test case with
os.mkdir, chdir, etc. would be great.

@devdanzin devdanzin mannequin added type-bug An unexpected behavior, bug, or error labels Feb 12, 2009
@brettcannon
Copy link
Member

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant