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

Test Discovery failed: Error: EISDIR: illegal operation on a directory, read #435

Closed
pscelzamelo opened this issue Dec 15, 2017 · 12 comments · Fixed by #466
Closed

Test Discovery failed: Error: EISDIR: illegal operation on a directory, read #435

pscelzamelo opened this issue Dec 15, 2017 · 12 comments · Fixed by #466
Labels
area-testing bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@pscelzamelo
Copy link

Environment data

VS Code version: November 2017 (version 1.19)
Python Extension version: Version 0.9.0 (14 December 2017)
Python Version: 2.7.14
OS and version: OSX 10.13.1

Actual behavior

Test discovery is not working.

Steps to reproduce:

  • Update VSCode to 1.19
  • Try to run test discovery

Logs

Output from Python output panel

Test Discovery failed: 
Error: EISDIR: illegal operation on a directory, read
Test Discovery failed: 
Error: EISDIR: illegal operation on a directory, read

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

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/pedromelo/.vscode/extensions/ms-python.python-0.9.0/out/client/common/envFileParser.js:26:23)
	at Object.getCustomEnvVarsSync (/Users/pedromelo/.vscode/extensions/ms-python.python-0.9.0/out/client/common/utils.js:388:38)
	at JediProxy.onConfigChanged (/Users/pedromelo/.vscode/extensions/ms-python.python-0.9.0/out/client/providers/jediProxy.js:519:47)
	at new JediProxy (/Users/pedromelo/.vscode/extensions/ms-python.python-0.9.0/out/client/providers/jediProxy.js:132:14)
	at JediFactory.getJediProxyHandler (/Users/pedromelo/.vscode/extensions/ms-python.python-0.9.0/out/client/languageServices/jediProxyFactory.js:27:31)
	at ItemInfoSource.<anonymous> (/Users/pedromelo/.vscode/extensions/ms-python.python-0.9.0/out/client/providers/itemInfoSource.js:74:43)
t.log @ console.ts:123
console.ts:123 [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/pedromelo/.vscode/extensions/ms-python.python-0.9.0/out/client/common/envFileParser.js:26:23)
	at Object.getCustomEnvVarsSync (/Users/pedromelo/.vscode/extensions/ms-python.python-0.9.0/out/client/common/utils.js:388:38)
	at JediProxy.spawnProcess (/Users/pedromelo/.vscode/extensions/ms-python.python-0.9.0/out/client/providers/jediProxy.js:214:51)
	at JediProxy.initialize (/Users/pedromelo/.vscode/extensions/ms-python.python-0.9.0/out/client/providers/jediProxy.js:177:14)
	at new JediProxy (/Users/pedromelo/.vscode/extensions/ms-python.python-0.9.0/out/client/providers/jediProxy.js:133:14)
	at JediFactory.getJediProxyHandler (/Users/pedromelo/.vscode/extensions/ms-python.python-0.9.0/out/client/languageServices/jediProxyFactory.js:27:31)
t.log @ console.ts:123
2console.ts:123 [Extension Host] Python Extension: documentHasJupyterCodeCells.promises Error: EISDIR: illegal operation on a directory, read
t.log @ console.ts:123
4console.ts:123 [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/pedromelo/.vscode/extensions/ms-python.python-0.9.0/out/client/common/envFileParser.js:26:23)
	at /Users/pedromelo/.vscode/extensions/ms-python.python-0.9.0/out/client/common/utils.js:366:42
	at Generator.next (<anonymous>)
	at fulfilled (/Users/pedromelo/.vscode/extensions/ms-python.python-0.9.0/out/client/common/utils.js:4:58)
	at <anonymous>
t.log @ console.ts:123
2console.ts:123 [Extension Host] Python Extension: documentHasJupyterCodeCells.promises Error: EISDIR: illegal operation on a directory, read
t.log @ console.ts:123
2console.ts:123 [Extension Host] rejected promise not handled within 1 second
t.log @ console.ts:123
log.ts:165   ERR EISDIR: illegal operation on a directory, read: Error: EISDIR: illegal operation on a directory, read
2console.ts:123 [Extension Host] rejected promise not handled within 1 second
t.log @ console.ts:123
2console.ts:123 [Extension Host] Python Extension: documentHasJupyterCodeCells.promises Error: EISDIR: illegal operation on a directory, read
t.log @ console.ts:123
console.ts:123 [Extension Host] rejected promise not handled within 1 second
t.log @ console.ts:123
log.ts:165   ERR EISDIR: illegal operation on a directory, read: Error: EISDIR: illegal operation on a directory, read
2console.ts:123 [Extension Host] rejected promise not handled within 1 second
t.log @ console.ts:123
console.ts:123 [Extension Host] (node:1596) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
t.log @ console.ts:123
@DonJayamanne
Copy link

Please could you provide the contents of your workspace settings (settings.json)

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster area-testing bug Issue identified by VS Code Team member as probable bug labels Dec 15, 2017
@pscelzamelo
Copy link
Author

pscelzamelo commented Dec 15, 2017

Of course, thank you for fast response

{
    "editor.fontSize": 12,
    "terminal.integrated.fontSize": 12,
    "git.enableSmartCommit": true,
    "html.format.contentUnformatted": "pre, style",
    "html.format.maxPreserveNewLines": 0,
    "editor.renderControlCharacters": true,
    "editor.renderWhitespace": "none",
    "editor.minimap.enabled": true,
    "python.unitTest.pyTestEnabled": true,
    "python.unitTest.pyTestArgs": [
        "--exitfirst"
        ,"--verbose"
        ,"--disable-warnings"
        ,"--no-cov"
        ,"-s"
    ],
    "python.linting.enabled": true,
    "python.linting.pylintEnabled": true,
    "python.linting.pylintArgs": [
        "--disable=E1101,C0103,C0111,C0301,W0235,R0903,R0913"
    ],
    "python.linting.pep8Enabled": true,
    "python.linting.pep8Args": [
        "--ignore=W291,W293,E501" 
    ],
    "python.formatting.provider": "autopep8",
    "files.exclude": {
        "**/*.pyc": true
    },
    "javascript.format.enable": true,
    "standard.autoFixOnSave": true,
    "window.zoomLevel": 0,
    "workbench.colorTheme": "Visual Studio Light",
    "workbench.editor.enablePreview": true,
    "extensions.ignoreRecommendations": false,
    "terminal.integrated.shell.osx": "/bin/zsh",
    "search.exclude": {
        "**/node_modules": true,
        "**/bower_components": true,
        "**/htmlcov": true
    }
}

@DonJayamanne
Copy link

  • Do you have a directory named .env in your workspace?
  • Please could you try the following, create an empty file named .envFile in your workspace and add the following into your workspace settings settings.json:
"python.envFile": "${workspaceFolder}/.envFile"

@pscelzamelo
Copy link
Author

That made the fix. Test discovery and execution is running as normal.

Thanks very much for the fast support, my env is up and running for now!

Did I screw up anything in my configs or actually helped find out a bug?

@DonJayamanne
Copy link

Do you have a directory named .env in your workspace?

Please could you confirm the above.

@DonJayamanne DonJayamanne added awaiting 2-PR and removed info-needed Issue requires more information from poster labels Dec 15, 2017
@pscelzamelo
Copy link
Author

Yes I do, I used to setup virtualenv on .env/, then activate it on terminal then opening code . to start working

@DonJayamanne
Copy link

helped find out a bug?

Thanks, yes you have helped us find an interesting bug. Looks like a nodejs bug of some sorts. Will have to implement a workaround. Thanks, should be easy enough to fix.

@pscelzamelo
Copy link
Author

Happy for that! Thank you very much!

@aidan-
Copy link

aidan- commented Dec 21, 2017

It looks like I have hit a similar bug to this. For me the symptom was after creating a virtualenv in .env/, pylint stopped running/outputting anything. There was also no output at all in the OUTPUT tab and I had similar JS errors to @pscelzamelo in the debugging windows.

After creating the empty .envFile and adding the additional configuration line to the workspace settings, pylint is now working as expected.

@DonJayamanne
Copy link

@aidan- looks like you have encountered the same issue as #435

@lalvarezguillen
Copy link

I got here from #482 , and just wanted to confirm that this solution worked for me as well. None of the Python linters or Mypy were working, and I had a .env directory in the workspace.

Thanks for the solution!

@VFagundes
Copy link

I had the same problem, the .envFile worked for me too 😄

DonJayamanne added a commit that referenced this issue Jan 3, 2018
Refactor how environment variables are parsed and used in tools, language server and debugger

Fixes #316 (PYTHONPATH not used as extra path for auto complete)
Fixes #183 (changes to .env file requires restarts of vscode)
Fixes #436 (Path variables not inherited when debugging)
Fixes #435 (Virtual environment name is same as the default environment file)
@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
area-testing bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants