Skip to content

parse-error raised if directory matches standard library name #4909

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

Closed
whonore opened this issue Aug 24, 2021 · 1 comment
Closed

parse-error raised if directory matches standard library name #4909

whonore opened this issue Aug 24, 2021 · 1 comment
Labels

Comments

@whonore
Copy link

whonore commented Aug 24, 2021

Bug description

pylint doesn't seem to like it when a directory has the same name as a standard library module, see the output below. I get the same error with something like pylint ./tests too. It works fine if you specify a specific file, like pylint tests/a.py.

Possibly related: #4444

Configuration

No response

Command used

mkdir pylint-test; cd pylint-test
mkdir collections math tests dir1 dir2
pylint *

Pylint output

************* Module math
math/__init__.py:1:0: F0010: error while code parsing: Unable to load file math/__init__.py:
[Errno 2] No such file or directory: 'math/__init__.py' (parse-error)
************* Module collections
collections/__init__.py:1:0: F0010: error while code parsing: Unable to load file collections/__init__.py:
[Errno 2] No such file or directory: 'collections/__init__.py' (parse-error)
************* Module tests
tests/__init__.py:1:0: F0010: error while code parsing: Unable to load file tests/__init__.py:
[Errno 2] No such file or directory: 'tests/__init__.py' (parse-error)

Expected behavior

No output since all the directories are empty.

Pylint version

pylint 2.10.2
astroid 2.7.2
Python 3.9.6 (default, Aug 16 2021, 15:13:47) 
[GCC 9.3.0]

OS / Environment

OS (uname -srvmpio):
Linux 5.11.0-27-generic #29~20.04.1-Ubuntu SMP Wed Aug 11 15:58:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Shell:
fish 3.3.1

Additional dependencies

No response

@whonore whonore added Bug 🪲 Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Aug 24, 2021
@Pierre-Sassoulas Pierre-Sassoulas added Import system and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Aug 25, 2021
@Pierre-Sassoulas Pierre-Sassoulas changed the title Linting fails if directory matches standard library name parse-error raised if directory matches standard library name Jul 2, 2022
@jacobtylerwalls
Copy link
Member

Thanks for the clear report. Based on some digging (and a draft patch) I believe this to be a duplicate of #4444.

@jacobtylerwalls jacobtylerwalls closed this as not planned Won't fix, can't repro, duplicate, stale Jul 3, 2022
@jacobtylerwalls jacobtylerwalls added the Duplicate 🐫 Duplicate of an already existing issue label Jul 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants