microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.25k stars 1.15k forks source link

Error occurs with "Python: Report Issue..." if certain extension is loaded #23268

Open manjuu-eater opened 2 months ago

manjuu-eater commented 2 months ago

Type: Bug

Behaviour

If certain extension is loaded, error message appears when executing a command "Python: Report Issue...". If I disabled all extensions with code --disable-extensions, error disappears.

Sorry if vscode-python is not wrong. (If so, is this problem related to VS Code itself...?)

Steps to reproduce:

  1. open Command Palette
  2. execute "Python: Report Issue..."
  3. error message appears if certain extension is loaded.

Extensions which causes error in my VS Code is below:

If both of these two extensions are not loaded, Issue Reporter appears normally.

Error message is below: error message

[Window Title]
Visual Studio Code

[Main Instruction]
Command 'Python: Report Issue...' resulted in an error

[Content]
Cannot read properties of undefined (reading 'localeCompare')

[OK]

Extension Host log is below:

2024-04-20 19:41:27.497 [error] TypeError: Cannot read properties of undefined (reading 'localeCompare')
    at c:\Users\User\.vscode\extensions\ms-python.python-2024.4.1\out\client\extension.js:2:103188
    at Array.sort (<anonymous>)
    at _.openReportIssue (c:\Users\User\.vscode\extensions\ms-python.python-2024.4.1\out\client\extension.js:2:103149)
    at async d.h (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:152:186866) python.reportIssue {"value":"ms-python.python","_lower":"ms-python.python"}

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

``` 2024-04-20 19:36:18.301 [info] Experiment 'pythonaacf' is active 2024-04-20 19:36:18.301 [info] Experiment 'pythonRecommendTensorboardExt' is active 2024-04-20 19:36:18.301 [info] Experiment 'pythonREPLSmartSend' is active 2024-04-20 19:36:18.301 [info] Experiment 'pythonSurveyNotificationcf' is active 2024-04-20 19:36:18.301 [info] Experiment 'pythonTerminalEnvVarActivation' is active 2024-04-20 19:36:18.301 [info] Experiment 'pythonTestAdapter' is active 2024-04-20 19:36:18.301 [info] Test server listening. 2024-04-20 19:36:18.301 [info] Python interpreter path: C:\Program Files\Python311\python.exe 2024-04-20 19:36:20.061 [info] Starting Pylance language server. 2024-04-20 20:17:49.682 [info] Experiment 'pythonaacf' is active 2024-04-20 20:17:49.683 [info] Experiment 'pythonRecommendTensorboardExt' is active 2024-04-20 20:17:49.683 [info] Experiment 'pythonREPLSmartSend' is active 2024-04-20 20:17:49.683 [info] Experiment 'pythonSurveyNotificationcf' is active 2024-04-20 20:17:49.683 [info] Experiment 'pythonTerminalEnvVarActivation' is active 2024-04-20 20:17:49.683 [info] Experiment 'pythonTestAdapter' is active 2024-04-20 20:17:49.685 [info] Test server listening. 2024-04-20 20:17:49.689 [info] Python interpreter path: C:\Program Files\Python311\python.exe 2024-04-20 20:17:51.620 [info] Starting Pylance language server. 2024-04-20 20:18:13.426 [info] Experiment 'pythonaacf' is active 2024-04-20 20:18:13.426 [info] Experiment 'pythonRecommendTensorboardExt' is active 2024-04-20 20:18:13.426 [info] Experiment 'pythonREPLSmartSend' is active 2024-04-20 20:18:13.426 [info] Experiment 'pythonSurveyNotificationcf' is active 2024-04-20 20:18:13.426 [info] Experiment 'pythonTerminalEnvVarActivation' is active 2024-04-20 20:18:13.426 [info] Experiment 'pythonTestAdapter' is active 2024-04-20 20:18:13.427 [info] Test server listening. 2024-04-20 20:18:13.432 [info] Python interpreter path: C:\Program Files\Python311\python.exe 2024-04-20 20:18:15.357 [info] Starting Pylance language server. ```

Extension version: 2024.4.1 VS Code version: Code 1.88.1 (e170252f762678dec6ca2cc69aba1570769a5d39, 2024-04-10T17:41:02.734Z) OS version: Windows_NT x64 10.0.19045 Modes:

User Settings

``` languageServer: "Pylance" ```

Installed Extensions |Extension Name|Extension Id|Version| |---|---|---| |autoDocstring - Python Docstring Generator|njpwerner.autodocstring|0.6.1| |Azure Repos|ms-vscode.azure-repos|0.38.0| |Bookmarks|alefragnani.Bookmarks|13.5.0| |Cursor Align|yo1dog.cursor-align|1.1.2| |Debugger for Firefox|firefox-devtools.vscode-firefox-debug|2.9.10| |Edit csv|janisdd.vscode-edit-csv|0.9.1| |ESLint|dbaeumer.vscode-eslint|2.4.4| |filesize|mkxml.vscode-filesize|3.1.0| |flexibleZenkaku|lowpolysnow.flexible-zenkaku|0.0.1| |Git Graph|mhutchie.git-graph|1.30.0| |Git History|donjayamanne.githistory|0.6.20| |GitHub Codespaces|GitHub.codespaces|1.16.19| |GitHub Repositories|GitHub.remotehub|0.62.0| |gitignore|codezombiech.gitignore|0.9.0| |GitLens — Git supercharged|eamodio.gitlens|14.9.0| |Import Cost|wix.vscode-import-cost|3.3.0| |isort|ms-python.isort|2023.10.1| |Japanese Language Pack for Visual Studio Code|MS-CEINTL.vscode-language-pack-ja|1.88.2024041009| |Japanese Word Handler|sgryjp.japanese-word-handler|1.4.1| |JavaScript Debugger|ms-vscode.js-debug|1.88.0| |JavaScript Debugger Companion Extension|ms-vscode.js-debug-companion|1.1.2| |Jupyter|ms-toolsai.jupyter|2024.3.1| |Jupyter Cell Tags|ms-toolsai.vscode-jupyter-cell-tags|0.1.9| |Jupyter Keymap|ms-toolsai.jupyter-keymap|1.1.2| |Jupyter Notebook Renderers|ms-toolsai.jupyter-renderers|1.0.17| |Jupyter Slide Show|ms-toolsai.vscode-jupyter-slideshow|0.1.6| |Live Preview|ms-vscode.live-server|0.4.13| |merge-n-paste|RAWSEQ.merge-n-paste|1.3.7| |Multiple cursor case preserve|Cardinal90.multi-cursor-case-preserve|1.0.5| |Path Intellisense|christian-kohler.path-intellisense|2.8.5| |Peacock|johnpapa.vscode-peacock|4.2.2| |PHP Debug|xdebug.php-debug|1.34.0| |PHP Intelephense|bmewburn.vscode-intelephense-client|1.10.4| |Prettier - Code formatter|esbenp.prettier-vscode|10.4.0| |Pylance|ms-python.vscode-pylance|2024.4.1| |Python|ms-python.python|2024.4.1| |Python Debugger|ms-python.debugpy|2024.4.0| |Python Indent|KevinRose.vsc-python-indent|1.18.0| |Rainbow CSV|mechatroner.rainbow-csv|3.11.0| |Remote Repositories|ms-vscode.remote-repositories|0.40.0| |Reopen Closed Tab|uyiosa-enabulele.reopenclosedtab|1.1.0| |SFTP|Natizyskunk.sftp|1.16.3| |Svg Preview|SimonSiefke.svg-preview|2.8.3| |Table Visualizer for JavaScript Profiles|ms-vscode.vscode-js-profile-table|1.0.8| |VS Code Counter|uctakeoff.vscode-counter|3.4.0| |vscode-input-sequence|tomoki1207.vscode-input-sequence|0.2.0| |vscode-pdf|tomoki1207.pdf|1.2.2| |Zoom Bar|wraith13.zoombar-vscode|1.4.4|
System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (8 x 3408)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|7.90GB (1.31GB free)| |Process Argv|--crash-reporter-id 9963c767-2656-4ecc-b62b-9405d4b964a1 --crash-reporter-id 9963c767-2656-4ecc-b62b-9405d4b964a1 --crash-reporter-id 9963c767-2656-4ecc-b62b-9405d4b964a1 --crash-reporter-id 9963c767-2656-4ecc-b62b-9405d4b964a1| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vscoreces:30445986 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 2i9eh265:30646982 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 2e7ec940:31000449 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 d34g3935:30971562 fegfb526:30981948 bg6jg535:30979843 ccp1r6:30993540 dsvsc020:30976470 pythonait:31006305 gee8j676:31009558 showvideot:31016892 dsvsc021:30996838 01bff139:31013167 pythoncenvpt:31022790 ```
LazarusX commented 2 months ago

I am having the same issue, and the issue persists even if I uninstalled the extensions causing the error and restarted VS Code.

manjuu-eater commented 2 months ago

@LazarusX did you try code --disable-extensions ? if error continues yet, it is another issue. If error disappears, there is another extension causes error.

manjuu-eater commented 2 months ago

How to find extensions that causing error:

  1. make new folder to anywhere and name it randomly
  2. open the folder as workspace
  3. execute >Extensions: Disable All Installed Extensions for this Workspace in Command Palette
  4. execute >Developer: Reload Window
  5. open "Extensions" sidebar
  6. first, enable "Python" extension
  7. select any other disabled extension
  8. click cog
  9. click "Enable (Workspace)"
  10. execute >Python: Report Issue...
  11. if error doesn't occurs, the extension is safe. Return to step 7 and continue.

If you find extensions that causes this error, please report it here. More samples should help solve this issue.

LazarusX commented 2 months ago

I now believe it's an issue with other extensions. I just installed a fresh VS Code Insiders with only Python related extensions installed, and the issue disappeared.

LazarusX commented 2 months ago

@manjuu-eater Thanks for the help. Will try to see if I can get more information.