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 2023.10.50 (pyright cfe56bfb) crashes on displaying symbols in debug console (in jupyter) #5036

Closed
MichaelXt opened this issue Oct 27, 2023 · 6 comments
Assignees
Labels
needs repro Issue has not been reproduced yet user responded Was "waiting for user response" and they responded

Comments

@MichaelXt
Copy link

MichaelXt commented Oct 27, 2023

Environment data

  • Language Server version: 2023.10.50
  • OS and version: linux x64
  • Python version (and distribution if applicable, e.g. Anaconda): python 3.12 conda
  • python.analysis.indexing: true
  • python.analysis.typeCheckingMode: basic

Repro Steps

gif for repro with the sample min code:

pylance

run cell under debugger. type in variable name in the debug console, press enter.

Expected: the variable value is printed.

Actual: the debugger crashes.

Note: the previous version of pylance works correctly without a crash

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Oct 27, 2023
@debonte
Copy link
Contributor

debonte commented Dec 1, 2023

@MichaelXt, it's not clear to me how this is related to Pylance. Did you mean to file this issue against debugpy?

If Pylance is crashing, can you please provide the contents of the "Python Language Server" log?

@debonte debonte added the waiting for user response Requires more information from user label Dec 1, 2023
@MichaelXt
Copy link
Author

@debonte, The issue appeared when pylance extension was updated to 2023.10.50 version. Reverting it back solved the issue. If the issue is related to debugpy, corresponding reasoning is needed, and the issue can be transferred.

@github-actions github-actions bot added user responded Was "waiting for user response" and they responded and removed waiting for user response Requires more information from user labels Dec 4, 2023
@debonte
Copy link
Contributor

debonte commented Jan 6, 2024

I'm unable to reproduce this.

@int19h, any idea how this could be related to Pylance? Or how the user can collect more information for us? I tried enabling debugpy logging via the DEBUGPY_LOG_DIR environment variable, but didn't see any logs generated.

@debonte
Copy link
Contributor

debonte commented Jan 9, 2024

I talked with Pavel offline and he said:

I don't see how Pylance could possibly be related here. It's more likely that user has also updated Jupyter and now there's some kind of conflict there.

For logs, the problem usually is that the env var is set in the wrong context - it needs to be visible to all processes from which you want to collect logs. For best results I set it for both VSCode (and thus everything it spawns, including the debug adapter) and also the debuggee. But I'm not sure how exactly that works in case of Jupyter when running from VSCode; i.e. if the env vars are propagated there when spinning it up.

If that is the case, it should also be possible to do import debugpy; debugpy.log_to("...") from the notebook itself to the same effect.

@debonte
Copy link
Contributor

debonte commented Jan 11, 2024

@MichaelXt, can you please enable debugpy logging as described here, reproduce the crash, and then provide the resulting log files?

I did this on my Ubuntu machine by adding the following to my /env/environment file and then logging out and back in again. Not sure if this is the best way to do it, but it worked :)

DEBUGPY_LOG_DIR="/home/erikd/temp/debugpylogs"

@debonte debonte added waiting for user response Requires more information from user and removed user responded Was "waiting for user response" and they responded labels Jan 11, 2024
@MichaelXt
Copy link
Author

Just got back to that issue. Updated to latest pylance and other extensions - no issue anymore. Probably was some mismatch in extensions. Now everything works as expected.

@github-actions github-actions bot added user responded Was "waiting for user response" and they responded and removed waiting for user response Requires more information from user labels Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet user responded Was "waiting for user response" and they responded
Projects
None yet
Development

No branches or pull requests

2 participants