You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
2018.3.0: Pylint: 'F0001:No module named "test.py"' appears in every file with a path that has a space #1239
Since installing the 2018.3.0 version of this extension about an hour ago, I get 'F0001:No module named "test.py"' at the top of every module from pylint (for line 1, character 1), with test.py being replaced with the file's filename.
This happens even if the file is the only file in its dir. This also only happens with existing VS Code projects, but not new ones.
This is definitely related to this extension and pylint. Because when I copy my project to a new folder, then open it in VSC, these errors disappear. But the original project location still has these errors.
This makes it incredibly difficult to fix on my own, since I don't know where to look, with regards to VSC. It must be something to do with an internal VS Code database?
Edit: As noted here, this problem only happens with paths with spaces in them. I was able to reproduce this myself.
I'm getting this error only from projects with spaces in their paths, either new or existing. Can anyone check if this is the case too?
(VS Code 1.22.0-insider on Sierra)
I'm getting this error only from projects with spaces in their paths, either new or existing.
Excellent observation! This is the answer. I was able to reproduce.
I was testing in a path with no space. I added a space. Immediate error. Should be an easy fix in the extension though, but otherwise there isn't anything we can do on our end unfortunately.
changed the title [-]Since installing 2018.3.0, I get 'F0001:No module named "test.py"' at the top of every module from pylint.[/-][+]2018.3.0: Pylint: 'F0001:No module named "test.py"' appears in every file with a path that has a space[/+]on Mar 29, 2018
I also experienced this problem.
I also went to the OUTPUT tab at the bottom of the editor found out what actually caused the error.
Assume that /Path with space/to/your/source_code.py is the path to your module source_code
I see:
************* Module "/Path with space/to/your/source_code.py"
1,0,fatal,F0001:No module named "source_code.py"
but when I run it from the command line, I see: ************* Module source_code
(Followed by lint feedbacks...)
That means the module is resolved incorrectly when there's a space in the path so VS Code has to quote it. Pylint is confused about the quotes VS Code gives it and treat the path with quotes and .py as a module, no wonder the module is not found
Strangely, even when I run the command pylint "/Path with space/to/your/source_code.py" instead of pylint source_code in the directory containing source_code.py, the module is resolved correctly
Quick update: we are waiting for tests to complete on our fix and then we will push out a hotfix release. We are hoping to have all of this resolved in the next 30 minutes.
Activity
dhruvmhjn commentedon Mar 29, 2018
Yup, I just noticed the exact same issue.
amyspark commentedon Mar 29, 2018
I'm getting this error only from projects with spaces in their paths, either new or existing. Can anyone check if this is the case too?
(VS Code 1.22.0-insider on Sierra)
garyking commentedon Mar 29, 2018
Excellent observation! This is the answer. I was able to reproduce.
I was testing in a path with no space. I added a space. Immediate error. Should be an easy fix in the extension though, but otherwise there isn't anything we can do on our end unfortunately.
[-]Since installing 2018.3.0, I get 'F0001:No module named "test.py"' at the top of every module from pylint.[/-][+]2018.3.0: Pylint: 'F0001:No module named "test.py"' appears in every file with a path that has a space[/+]brettcannon commentedon Mar 29, 2018
We can reproduce on our end. We're trying to figure out the root cause.
chikaobuah commentedon Mar 29, 2018
Getting same issue too. The latest update is full of bugs.
kevin-he-01 commentedon Mar 29, 2018
I also experienced this problem.
I also went to the OUTPUT tab at the bottom of the editor found out what actually caused the error.
Assume that
/Path with space/to/your/source_code.pyis the path to your modulesource_codeI see:
but when I run it from the command line, I see:
************* Module source_code(Followed by lint feedbacks...)
That means the module is resolved incorrectly when there's a space in the path so VS Code has to quote it. Pylint is confused about the quotes VS Code gives it and treat the path with quotes and
.pyas a module, no wonder the module is not foundStrangely, even when I run the command
pylint "/Path with space/to/your/source_code.py"instead ofpylint source_codein the directory containingsource_code.py, the module is resolved correctlychikaobuah commentedon Mar 29, 2018
How can I uninstall or opt out of latest update?
DonJayamanne commentedon Mar 29, 2018
Chika (@chikaobuah) We're in the process of fixing this. A hot fix will be release soon.
Apologies for the inconvenience.
shaharpit191 commentedon Mar 29, 2018
You will also find the same error if your name contains any numbers. I removed numbers from my file name and it worked.
brettcannon commentedon Mar 29, 2018
Quick update: we are waiting for tests to complete on our fix and then we will push out a hotfix release. We are hoping to have all of this resolved in the next 30 minutes.
brettcannon commentedon Mar 29, 2018
OK,
2018.3.1is now live with a fix for this! Sorry everyone for letting this slip out.dhruvmhjn commentedon Mar 30, 2018
My first experience reporting such a bug. That was quick. Thanks!
Fixes issue that causes linter to fail when file path contains spaces. (