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

Turtle widget code fails to run the second time but succeeds the third time #11509

Closed
2 tasks done
ydmykr opened this issue Oct 3, 2022 · 4 comments
Closed
2 tasks done
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Issue needs to be triaged

Comments

@ydmykr
Copy link

ydmykr commented Oct 3, 2022

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

import turtle as ttl

ttl.shape('turtle')
ttl.speed(0)

# draw a line
ttl.forward(200)

ttl.mainloop()
print('done')

If you run it twice, it will report an error. The third time, it can run normally again. Unless you kill the kernel, an error will occur every time you run it repeatedly.

Terminator                                Traceback (most recent call last)
c:\newPython\test.ipynb Cell 2 in <cell line: 1>()
----> [1](vscode-notebook-cell:/c%3A/newPython/test.ipynb#W1sZmlsZQ%3D%3D?line=0) ttl.shape('turtle')
      [2](vscode-notebook-cell:/c%3A/newPython/test.ipynb#W1sZmlsZQ%3D%3D?line=1) ttl.speed(0)
      [4](vscode-notebook-cell:/c%3A/newPython/test.ipynb#W1sZmlsZQ%3D%3D?line=3) # draw a line

File <string>:5, in shape(name)

Terminator:

VS Code Version

1.71.2

Jupyter Extension Version

v2022.8.1002431955

Jupyter logs

info 9:45:11.383: Execute Cell 0 c:\newPython\test.ipynb
info 9:45:11.423: Cell 0 executed with state Success
info 9:45:13.223: Execute Cell 1 c:\newPython\test.ipynb
info 9:45:14.751: Cell 1 executed with state Success
info 9:45:16.767: Execute Cell 1 c:\newPython\test.ipynb
info 9:45:16.923: Cancel all remaining cells true || Error || undefined
info 9:45:16.923: Cancel pending cells
info 9:45:16.924: Cell 1 executed with state Error

Coding Language and Runtime Version

Python 3.10

Language Extension Version (if applicable)

Python Pylance jupyter

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

No response

@ydmykr ydmykr added bug Issue identified by VS Code Team member as probable bug triage-needed Issue needs to be triaged labels Oct 3, 2022
@amunger amunger assigned DonJayamanne and unassigned amunger Oct 3, 2022
@amunger
Copy link
Contributor

amunger commented Oct 3, 2022

It might just have some trouble with initialization and teardown of the external app. Looks like @DonJayamanne has done some previous work to get turtle working on #8241

@DonJayamanne
Copy link
Contributor

@ydmykr
Can you run the same code in Jupyter Notebook (outside VS Code) and let me know if you run into the same problem

@DonJayamanne DonJayamanne added the info-needed Issue requires more information from poster label Oct 3, 2022
@DonJayamanne DonJayamanne changed the title File <string>:5, in shape(name) Turtle widget code fails to run the second time but succeeds the third time Oct 3, 2022
@ydmykr
Copy link
Author

ydmykr commented Oct 6, 2022

image

Unfortunately, I will still encounter the same problem.

@DonJayamanne
Copy link
Contributor

Thanks for getting back to us, Looks like a problem with the package itself, or other.
Unfortunately I'm not an expert of the turtle widget, please react out to the maintainers of the turtle package for assistance.
Closing this issue as this isn't a problem with the Jupyter extension.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants