Skip to content

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

@aliev

Description

@aliev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions