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

Python 3 linter does not work (pylint, flake8) #482

Closed
aliev opened this issue Dec 23, 2017 · 3 comments
Closed

Python 3 linter does not work (pylint, flake8) #482

aliev opened this issue Dec 23, 2017 · 3 comments
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@aliev
Copy link

aliev commented Dec 23, 2017

Environment data

VS Code version: 1.19.1
Python Extension version: 0.9.1
Python Version: 3.6.3
OS and version: OS X 10.11.6

Actual behavior

PyLint and Flake8 does not work. I cannot see any errors / warnings in my code even if there are syntax errors

Expected behavior

Should show errors / warnings

Steps to reproduce:

  • mkdir -p Project/python
  • mkdir -p Project/javascript
  • touch Project/python/main.py
  • virtualenv -ppython3 Project/python/.env
  • source Project/python/.env/bin/activate
  • pip install pylint flake8
  • touch Project/Project.code-workspace
  • code Project/Project.code-workspace
{
	"folders": [
		{
			"path": "python"
		},
		{
			"path": "javascript"
		}
	],
}
  • code main.py
import pylint
def name():
    pass
  • flake8 main.py
main.py:1:1: F401 'pylint' imported but unused
main.py:2:1: E302 expected 2 blank lines, found 0
main.py:3:9: W292 no newline at end of file
  • open Project/Project.code-workspace
  • Open python/main.py file
  • make any syntax errors in main.py file
  • nothing happening

VSCode settings file

{
    "editor.fontFamily": "Fira Code",
    "editor.fontSize": 13,
    "editor.fontLigatures": true,
    "python.linting.flake8Enabled": true,
    "python.linting.enabled": true,
    "editor.minimap.enabled": false,
    "files.trimTrailingWhitespace": true,
    "editor.renderWhitespace": "none",
    "editor.renderIndentGuides": true,
    "window.zoomLevel": 0,
    "window.title": "${activeEditorMedium}${separator}${rootName}",
    "files.exclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": true,
        "**/.DS_Store": true,
        "**/*.pyc": true,
        "**/__pycache__": true
    },
    "python.formatting.provider": "yapf",
    "editor.wordWrap": "on",
    "javascript.validate.enable": false,
    "git.autofetch": true,
    "diffEditor.renderSideBySide": false,
    "editor.stablePeek": true,
    "editor.formatOnType": true,
    "telemetry.enableCrashReporter": false,
    "workbench.startupEditor": "none",
    "gitlens.advanced.messages": {
        "suppressCommitHasNoPreviousCommitWarning": false,
        "suppressCommitNotFoundWarning": false,
        "suppressFileNotUnderSourceControlWarning": false,
        "suppressGitVersionWarning": false,
        "suppressLineUncommittedWarning": false,
        "suppressNoRepositoryWarning": false,
        "suppressUpdateNotice": false,
        "suppressWelcomeNotice": true
    },
    "explorer.confirmDelete": false,
}

Logs

Output from Python output panel

Empty

Output from Console window (Help->Developer Tools menu)

[Extension Host] debugger listening on port 9334
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2569 [Extension Host] debugger inspector at %cDebugger listening on port 9334.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
    chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9334/eae2819c-334a-45ac-9028-ec1e1ab7ef66

2/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249 [Extension Host] Python Extension: documentHasJupyterCodeCells.promises Error: EISDIR: illegal operation on a directory, read
t.log @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249 [Extension Host] Failed to parse env file Error: EISDIR: illegal operation on a directory, read
	at Object.fs.readSync (fs.js:682:19)
	at tryReadSync (fs.js:480:20)
	at Object.fs.readFileSync (fs.js:517:19)
	at Object.exports.wrapFsWithAsar.fs.readFileSync (ELECTRON_ASAR.js:505:29)
	at Object.parseEnvFile (/Users/aliev/.vscode/extensions/ms-python.python-0.9.1/out/client/common/envFileParser.js:25:23)
	at Object.getCustomEnvVarsSync (/Users/aliev/.vscode/extensions/ms-python.python-0.9.1/out/client/common/utils.js:388:38)
	at JediProxy.onConfigChanged (/Users/aliev/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/jediProxy.js:519:47)
	at new JediProxy (/Users/aliev/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/jediProxy.js:132:14)
	at JediFactory.getJediProxyHandler (/Users/aliev/.vscode/extensions/ms-python.python-0.9.1/out/client/languageServices/jediProxyFactory.js:27:31)
	at CompletionSource.<anonymous> (/Users/aliev/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/completionSource.js:91:43)
t.log @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249 [Extension Host] Failed to parse env file Error: EISDIR: illegal operation on a directory, read
	at Object.fs.readSync (fs.js:682:19)
	at tryReadSync (fs.js:480:20)
	at Object.fs.readFileSync (fs.js:517:19)
	at Object.exports.wrapFsWithAsar.fs.readFileSync (ELECTRON_ASAR.js:505:29)
	at Object.parseEnvFile (/Users/aliev/.vscode/extensions/ms-python.python-0.9.1/out/client/common/envFileParser.js:25:23)
	at Object.getCustomEnvVarsSync (/Users/aliev/.vscode/extensions/ms-python.python-0.9.1/out/client/common/utils.js:388:38)
	at JediProxy.spawnProcess (/Users/aliev/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/jediProxy.js:214:51)
	at JediProxy.initialize (/Users/aliev/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/jediProxy.js:177:14)
	at new JediProxy (/Users/aliev/.vscode/extensions/ms-python.python-0.9.1/out/client/providers/jediProxy.js:133:14)
	at JediFactory.getJediProxyHandler (/Users/aliev/.vscode/extensions/ms-python.python-0.9.1/out/client/languageServices/jediProxyFactory.js:27:31)
t.log @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249
4/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249 [Extension Host] Failed to parse env file Error: EISDIR: illegal operation on a directory, read
	at Object.fs.readSync (fs.js:682:19)
	at tryReadSync (fs.js:480:20)
	at Object.fs.readFileSync (fs.js:517:19)
	at Object.exports.wrapFsWithAsar.fs.readFileSync (ELECTRON_ASAR.js:505:29)
	at Object.parseEnvFile (/Users/aliev/.vscode/extensions/ms-python.python-0.9.1/out/client/common/envFileParser.js:25:23)
	at /Users/aliev/.vscode/extensions/ms-python.python-0.9.1/out/client/common/utils.js:366:42
	at Generator.next (<anonymous>)
	at fulfilled (/Users/aliev/.vscode/extensions/ms-python.python-0.9.1/out/client/common/utils.js:4:58)
	at <anonymous>
t.log @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249
2/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249 [Extension Host] rejected promise not handled within 1 second
t.log @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1225   ERR EISDIR: illegal operation on a directory, read: Error: EISDIR: illegal operation on a directory, read
2/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249 [Extension Host] Python Extension: documentHasJupyterCodeCells.promises Error: EISDIR: illegal operation on a directory, read
t.log @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249
2/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249 [Extension Host] rejected promise not handled within 1 second
t.log @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1225   ERR EISDIR: illegal operation on a directory, read: Error: EISDIR: illegal operation on a directory, read
2/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249 [Extension Host] Python Extension: documentHasJupyterCodeCells.promises Error: EISDIR: illegal operation on a directory, read
t.log @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249
2/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249 [Extension Host] rejected promise not handled within 1 second
t.log @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1225   ERR EISDIR: illegal operation on a directory, read: Error: EISDIR: illegal operation on a directory, read
2/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249 [Extension Host] Python Extension: documentHasJupyterCodeCells.promises Error: EISDIR: illegal operation on a directory, read
t.log @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249
2/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249 [Extension Host] rejected promise not handled within 1 second
t.log @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:249
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1225   ERR EISDIR: illegal operation on a directory, read: Error: EISDIR: illegal operation on a directory, read

P.S. It works very well without virtual environment
P.P.S. Worked before python virtual environment of the python2.7, now it does not work as well

@DonJayamanne
Copy link

The solution is in #435
I'm closing this issue as it is a duplicate.

@DonJayamanne DonJayamanne added awaiting 3-merge bug Issue identified by VS Code Team member as probable bug labels Dec 23, 2017
@aliev
Copy link
Author

aliev commented Dec 23, 2017

@DonJayamanne ah great thank you! would be great to add the solution

"python.envFile": "${workspaceFolder}/.envFile"

to FAQ or document that.

@DonJayamanne
Copy link

That's a temporary solution, the Jan release will fix this so users wouldn't have to do anything.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants