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

Run cell through shift enter in ipynb cause code lost #2956

Closed
xgdgsc opened this issue Oct 9, 2019 · 6 comments
Closed

Run cell through shift enter in ipynb cause code lost #2956

xgdgsc opened this issue Oct 9, 2019 · 6 comments
Assignees

Comments

@xgdgsc
Copy link

xgdgsc commented Oct 9, 2019

Steps to cause the bug to occur

  1. Edit an existing cell inside ipynb
  2. press shift-enter

Actual & Expected behavior

Sometimes last edit would be lost and the code returns to what is before editing. While the output could be the new code generated.

Your Jupyter and/or Python environment

  • Jupyter server running: Local
  • Extension version: 2019.10.41019
  • VS Code version: 1.38.1
  • Setting python.jediEnabled: false
  • Python and/or Anaconda version: 3.7.3
  • OS: Linux (distro): Ubuntu 16.04
  • Virtual environment: conda

Developer Tools Console Output

workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:27: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:27: Submitting code for d2390ea9-5d62-43d9-ae95-b2a7fb39373b
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:27: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:27: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:27: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:27: Finished execution for e291f4ad-ca94-4e12-bf34-2622a6d58f08
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:35: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:35: Submitting code for d2390ea9-5d62-43d9-ae95-b2a7fb39373b
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:35: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:35: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:35: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:35: Finished execution for e291f4ad-ca94-4e12-bf34-2622a6d58f08
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:53: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:53: Submitting code for d2390ea9-5d62-43d9-ae95-b2a7fb39373b
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:53: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:53: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:53: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:07:54: Finished execution for e291f4ad-ca94-4e12-bf34-2622a6d58f08
workbench.desktop.main.js:sourcemap:230 [Extension Host] No editors associated with document: /home/sgao/.config/Code/User/settings.json
t.log @ workbench.desktop.main.js:sourcemap:230
workbench.desktop.main.js:sourcemap:230 [Extension Host] No editors associated with document: /home/sgao/.config/Code/User/settings.json
t.log @ workbench.desktop.main.js:sourcemap:230
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:09:09: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:09:09: Submitting code for d2390ea9-5d62-43d9-ae95-b2a7fb39373b
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:09:09: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:09:09: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:09:09: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:09:09: Finished execution for e291f4ad-ca94-4e12-bf34-2622a6d58f08
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:09:51: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:09:51: Submitting code for d2390ea9-5d62-43d9-ae95-b2a7fb39373b
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:09:51: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:09:51: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:09:51: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:09:51: Finished execution for e291f4ad-ca94-4e12-bf34-2622a6d58f08
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:02: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:02: Submitting code for d2390ea9-5d62-43d9-ae95-b2a7fb39373b
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:02: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:02: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:02: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:02: Finished execution for e291f4ad-ca94-4e12-bf34-2622a6d58f08
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:29: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:29: Submitting code for d2390ea9-5d62-43d9-ae95-b2a7fb39373b
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:29: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:29: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:29: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:30: Finished execution for e291f4ad-ca94-4e12-bf34-2622a6d58f08
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:41: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:41: Submitting code for d2390ea9-5d62-43d9-ae95-b2a7fb39373b
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:41: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:41: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:41: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:42: Finished execution for e291f4ad-ca94-4e12-bf34-2622a6d58f08
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:57: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:57: Submitting code for d2390ea9-5d62-43d9-ae95-b2a7fb39373b
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:57: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:57: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:57: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:10:57: Finished execution for e291f4ad-ca94-4e12-bf34-2622a6d58f08
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:11:22: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:11:22: Submitting code for d2390ea9-5d62-43d9-ae95-b2a7fb39373b
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:11:22: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:11:22: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:11:22: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:11:22: Finished execution for e291f4ad-ca94-4e12-bf34-2622a6d58f08
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:11:27: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:11:27: Submitting code for d2390ea9-5d62-43d9-ae95-b2a7fb39373b
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:11:27: Waiting for jupyter server and web panel ...
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:11:27: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:11:27: Wait for sys info for d2390ea9-5d62-43d9-ae95-b2a7fb39373b 0
workbench.desktop.main.js:sourcemap:230 [Extension Host] Info Python Extension: 2019-10-09 18:11:27: Finished execution for e291f4ad-ca94-4e12-bf34-2622a6d58f08

@rchiodo
Copy link
Contributor

rchiodo commented Oct 9, 2019

Thanks for the feedback. We should either disable cell editing while running, or not overwrite the text if it's newer.

@cezarymierzejek
Copy link

I believe I am experiencing the same issue though more severe. Running a cell works fine in the native editor. But if I edit the cell and rerun (even if nothing else is running) then the cell reverts to its original code every time.

If I save the entire notebook before running the cell then the updated code runs as expected. I also tried reinstalling the Python extension and the issue continues to persist.

My Environment:
Jupyter server running: Local
Extension version: 2019.10.41019
VS Code version: 1.39.0
Setting python.jediEnabled: True
Python and/or Anaconda version: 3.7.4
OS: MacOS Catalina (10.15)
Virtual environment: conda

@xgdgsc
Copy link
Author

xgdgsc commented Oct 11, 2019

Yes. Saving before running works.

@DonJayamanne DonJayamanne self-assigned this Oct 12, 2019
@DonJayamanne
Copy link
Contributor

@xgdsc @cezarymierzejek
Thanks for reporting this issue. I'm currently looking at this issue and am unable to replicate this at my end. Would you be able to provide detailed steps that I could use to repro at my end (or possibly a video/animated gif or the like).
Thanks

@cezarymierzejek
Copy link

@DonJayamanne
Please try the following:

  1. Ctrl Shift P -> Create New Blank Jupyter Notebook
  2. Type print('test this') in the new cell
  3. Shift Enter
  4. Go back to the cell and reduce the print statement to print('test')
  5. Shift Enter - you should see it print 'test this' instead of 'test'

If you save the notebook after step 4 but before step 5 then it will print correctly. Please let me know if you are able to replicate.

@rchiodo
Copy link
Contributor

rchiodo commented Oct 14, 2019

Validated

@rchiodo rchiodo closed this as completed Oct 14, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 21, 2019
@microsoft microsoft unlocked this conversation Nov 14, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants