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

2018.3.0: Pylint: 'F0001:No module named "test.py"' appears in every file with a path that has a space #1239

Closed
garyking opened this issue Mar 29, 2018 · 12 comments · Fixed by #1243
Labels
area-linting bug Issue identified by VS Code Team member as probable bug

Comments

@garyking
Copy link

garyking commented Mar 29, 2018

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.

@dhruvmhjn
Copy link

Yup, I just noticed the exact same issue.

@amyspark
Copy link

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
Copy link
Author

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.

@garyking garyking 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 Mar 29, 2018
@brettcannon brettcannon added bug Issue identified by VS Code Team member as probable bug area-linting needs verification and removed needs verification labels Mar 29, 2018
@brettcannon
Copy link
Member

We can reproduce on our end. We're trying to figure out the root cause.

@chikaobuah
Copy link

chikaobuah commented Mar 29, 2018

Getting same issue too. The latest update is full of bugs.

@kevin-he-01
Copy link

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

@chikaobuah
Copy link

How can I uninstall or opt out of latest update?

@DonJayamanne
Copy link

@chikaobuah We're in the process of fixing this. A hot fix will be release soon.
Apologies for the inconvenience.

@shaharpit191
Copy link

You will also find the same error if your name contains any numbers. I removed numbers from my file name and it worked.

@brettcannon
Copy link
Member

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
Copy link
Member

OK, 2018.3.1 is now live with a fix for this! Sorry everyone for letting this slip out.

@dhruvmhjn
Copy link

My first experience reporting such a bug. That was quick. Thanks!

DonJayamanne pushed a commit that referenced this issue Mar 30, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-linting bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants