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

Pylance crashes on VS Code startup because of previous interactive output #6382

Closed
smojef opened this issue Sep 11, 2024 · 1 comment
Closed
Assignees
Labels
duplicate This issue or pull request already exists needs repro Issue has not been reproduced yet

Comments

@smojef
Copy link

smojef commented Sep 11, 2024

Environment data

  • Pylance version: v2024.9.1
  • OS and version: Windows 10 22H2 19045.4780
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.10.9
  • settings.json:
    "python.analysis.logLevel": "Trace",
    "python.analysis.exclude": [
        "untitiled:*"
    ]

Code Snippet

#%%
# Press SHIFT+ENTER in this cell to execute in interactive mode
print("testing {[!")

#%%

Repro Steps

  1. Open VS Code
  2. Make sure to have Python and Jupyter extensions
  3. Create temp.py file and paste the code above
    image
  4. Press SHIFT+ENTER to execute the first cell
    image
  5. Close VS Code
  6. Re-open VS Code, which reopens the previous interactive output.
    image
  7. Pylance crashes

Expected behavior

Pylance should not to crash on previous interactive output.

Actual behavior

A popup appears:
Pylance has crashed 5 times in the last 3 minutes, Pylance will not be restarted. Please check this link for more details.

Logs

The output log for Python Language Server shows:

2024-09-11 17:50:27.758 [info] [Error - 5:50:27 PM] Server process exited with code 1.
2024-09-11 17:50:27.758 [info] Error: Debug Failure. False expression: Duplicate path in cellFilePaths: untitled:/Interactive-1.interactive.py#W1sdW50aXRsZWQ%3D


untitled:/Interactive-1.interactive.py
    at _0x3b1d9a (c:\Users\me\.vscode\extensions\ms-python.vscode-pylance-2024.9.1\dist\server.bundle.js:1:1040515)
    at _0x3c03f1 (c:\Users\me\.vscode\extensions\ms-python.vscode-pylance-2024.9.1\dist\server.bundle.js:1:1044937)
    at _0x4e65cb (c:\Users\me\.vscode\extensions\ms-python.vscode-pylance-2024.9.1\dist\server.bundle.js:1:1045372)
    at c:\Users\me\.vscode\extensions\ms-python.vscode-pylance-2024.9.1\dist\server.bundle.js:1:1001232

2024-09-11 17:50:27.767 [info] [Info  - 5:50:27 PM] Connection to server got closed. Server will restart.
2024-09-11 17:50:27.767 [info] true
2024-09-11 17:50:28.655 [info] [Info  - 5:50:28 PM] (27680) Server root directory: file:///c%3A/Users/me/.vscode/extensions/ms-python.vscode-pylance-2024.9.1/dist
2024-09-11 17:50:28.657 [info] [Info  - 5:50:28 PM] (27680) Pylance language server 2024.9.1 (pyright version 1.1.378, commit ce64adc1) starting
2024-09-11 17:50:28.665 [info] [Info  - 5:50:28 PM] (27680) Starting service instance "python_tests"
2024-09-11 17:50:28.701 [info] (Client) Jupyter provided interpreter path override: c:\Users\me\AppData\Local\Programs\Python\Python310\python.exe
2024-09-11 17:50:28.716 [info] (27680) No configuration file found.
2024-09-11 17:50:28.717 [info] (27680) No pyproject.toml file found.
2024-09-11 17:50:28.717 [info] [Info  - 5:50:28 PM] (27680) Setting environmentName for service "python_tests": "3.10.9 (global)"
2024-09-11 17:50:28.719 [info] [Info  - 5:50:28 PM] (27680) Setting pythonPath for service "python_tests": "C:\Users\me\AppData\Local\Programs\Python\Python310\python.exe"
2024-09-11 17:50:28.720 [info] [Info  - 5:50:28 PM] (27680) No include entries specified; assuming c:\Work\python_tests
2024-09-11 17:50:28.847 [info] [Info  - 5:50:28 PM] (27680) Assuming Python version 3.10.9.final.0
2024-09-11 17:50:28.847 [info] (27680) Assuming Python platform Windows
2024-09-11 17:50:29.147 [info] [Info  - 5:50:29 PM] (27680) Search paths for file:///c%3A/Work/python_tests
2024-09-11 17:50:29.149 [info] [Info  - 5:50:29 PM] (27680)   c:\Users\me\.vscode\extensions\ms-python.vscode-pylance-2024.9.1\dist\typeshed-fallback\stdlib
2024-09-11 17:50:29.149 [info] [Info  - 5:50:29 PM] (27680)   c:\Work\python_tests
2024-09-11 17:50:29.149 [info] [Info  - 5:50:29 PM] (27680)   c:\Work\python_tests\typings
2024-09-11 17:50:29.150 [info] [Info  - 5:50:29 PM] (27680)   c:\Users\me\.vscode\extensions\ms-python.vscode-pylance-2024.9.1\dist\typeshed-fallback\stubs\...
2024-09-11 17:50:29.150 [info] [Info  - 5:50:29 PM] (27680)   c:\Users\me\.vscode\extensions\ms-python.vscode-pylance-2024.9.1\dist\bundled\stubs
2024-09-11 17:50:29.151 [info] [Info  - 5:50:29 PM] (27680)   c:\Users\me\AppData\Local\Programs\Python\Python310\DLLs
2024-09-11 17:50:29.151 [info] [Info  - 5:50:29 PM] (27680)   c:\Users\me\AppData\Local\Programs\Python\Python310\Lib
2024-09-11 17:50:29.152 [info] [Info  - 5:50:29 PM] (27680)   c:\Users\me\AppData\Local\Programs\Python\Python310
2024-09-11 17:50:29.152 [info] [Info  - 5:50:29 PM] (27680)   c:\Users\me\AppData\Roaming\Python\Python310\site-packages
2024-09-11 17:50:29.152 [info] [Info  - 5:50:29 PM] (27680)   c:\Users\me\AppData\Roaming\Python\Python310\site-packages\win32
2024-09-11 17:50:29.153 [info] [Info  - 5:50:29 PM] (27680)   c:\Users\me\AppData\Roaming\Python\Python310\site-packages\win32\lib
2024-09-11 17:50:29.153 [info] [Info  - 5:50:29 PM] (27680)   c:\Users\me\AppData\Roaming\Python\Python310\site-packages\pythonwin
2024-09-11 17:50:29.153 [info] [Info  - 5:50:29 PM] (27680)   c:\Users\me\AppData\Local\Programs\Python\Python310\Lib\site-packages
2024-09-11 17:50:29.153 [info] [Info  - 5:50:29 PM] (27680) Adding fs watcher for library directories:
 file:///c%3A/Users/me/AppData/Local/Programs/Python/Python310/DLLs
file:///c%3A/Users/me/AppData/Local/Programs/Python/Python310/Lib
file:///c%3A/Users/me/AppData/Local/Programs/Python/Python310
file:///c%3A/Users/me/AppData/Roaming/Python/Python310/site-packages
file:///c%3A/Users/me/AppData/Roaming/Python/Python310/site-packages/win32
file:///c%3A/Users/me/AppData/Roaming/Python/Python310/site-packages/win32/lib
file:///c%3A/Users/me/AppData/Roaming/Python/Python310/site-packages/pythonwin
file:///c%3A/Users/me/AppData/Local/Programs/Python/Python310/Lib/site-packages
2024-09-11 17:50:29.154 [info] [Info  - 5:50:29 PM] (27680) Adding fs watcher for directories:
 file:///c%3A/Work/python_tests
2024-09-11 17:50:29.154 [info] (27680) Searching for source files
2024-09-11 17:50:29.241 [info] [Info  - 5:50:29 PM] (27680) Found 76 source files
2024-09-11 17:50:29.277 [info] (27680) pytest configurations: {"message":"request cancelled","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2024-09-11 17:50:29.371 [info] (27680) Attempting to resolve using local imports: __builtins__
2024-09-11 17:50:29.374 [info] (27680) [FG] parsing: file:///c%3A/Work/python_tests/temp.py (90ms)
2024-09-11 17:50:29.458 [info] (27680) [FG] parsing: file:///c%3A/Users/me/.vscode/extensions/ms-python.vscode-pylance-2024.9.1/dist/typeshed-fallback/stdlib/builtins.pyi [fs read 2ms] (83ms)
2024-09-11 17:50:29.503 [info] (27680) [FG] binding: file:///c%3A/Users/me/.vscode/extensions/ms-python.vscode-pylance-2024.9.1/dist/typeshed-fallback/stdlib/builtins.pyi (43ms)
2024-09-11 17:50:29.503 [info] (27680) [FG] binding: file:///c%3A/Work/python_tests/temp.py (1ms)
2024-09-11 17:50:29.534 [info] 

2024-09-11 17:50:29.579 [info] c:\Users\me\.vscode\extensions\ms-python.vscode-pylance-2024.9.1\dist\server.bundle.js:1
(function(_0x2609d9,_0x322731){const _0x5072d0=a1_0x4a28,_0x2ba024=_0x2609d9();while(!![]){try{const _0x5b9fd3=parseInt(_0x5072d0(0x796))/0x1*(parseInt(_0x5072d0(0x12d3))/0x2)+-parseInt(_0x5072d0(0xcfe))/0x3*(parseInt(_0x5072d0(0x2f4))/0x4)+parseInt(_0x5072d0(0x1011))/0x5*(-parseInt(_0x5072d0(0x12b9))/0x6)+parseInt(_0x5072d0(0x195))/0x7+-parseInt(_0x5072d0(0x7de))/0x8*(-parseInt(_0x5072d0(0x766))/0x9)+-parseInt(_0x5072d0(0x1063))/0xa*(-parseInt(_0x5072d0(0x5bc))/0xb)+-parseInt
...


2024-09-11 17:50:31.160 [info] Error: Debug Failure. False expression: Duplicate path in cellFilePaths: untitled:/Interactive-1.interactive.py#W1sdW50aXRsZWQ%3D


untitled:/Interactive-1.interactive.py
    at _0x3b1d9a (c:\Users\me\.vscode\extensions\ms-python.vscode-pylance-2024.9.1\dist\server.bundle.js:1:1040515)
    at _0x3c03f1 (c:\Users\me\.vscode\extensions\ms-python.vscode-pylance-2024.9.1\dist\server.bundle.js:1:1044937)
    at _0x4e65cb (c:\Users\me\.vscode\extensions\ms-python.vscode-pylance-2024.9.1\dist\server.bundle.js:1:1045372)
    at c:\Users\me\.vscode\extensions\ms-python.vscode-pylance-2024.9.1\dist\server.bundle.js:1:1001232

2024-09-11 17:50:31.169 [info] [Error - 5:50:31 PM] Server process exited with code 1.
2024-09-11 17:50:31.173 [info] [Error - 5:50:31 PM] Pylance has crashed 5 times in the last 3 minutes. Pylance will not be restarted. Please check [this link](https://aka.ms/AApf7ox) for more details.


@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Sep 11, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Sep 11, 2024

Thanks for the issue.

This is a dupe of #6357. A fix for this should ship in our next prerelease build.

@rchiodo rchiodo closed this as completed Sep 11, 2024
@rchiodo rchiodo added the duplicate This issue or pull request already exists label Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

3 participants