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

variable __file__ is missing after kernel restart (again) #7883

Closed
elazarcoh opened this issue Oct 11, 2021 · 1 comment
Closed

variable __file__ is missing after kernel restart (again) #7883

elazarcoh opened this issue Oct 11, 2021 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release interactive-window Impacts interactive window

Comments

@elazarcoh
Copy link

elazarcoh commented Oct 11, 2021

Environment data

  • VS Code version: 1.61
  • Jupyter Extension version (available under the Extensions sidebar): v2021.9.1001312534
  • Python Extension version (available under the Extensions sidebar): v2021.11.1313923388-dev
  • OS (Windows | Mac | Linux distro) and version: Windows 10
  • Python and/or Anaconda version: 3.8.5
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Jupyter server running: Local (?, I'm starting an interactive window)

Seems like it happened before, in #1373. (Though this thread is locked now.)

Expected behaviour

__file__ variable should be defined

Actual behaviour

__file__ variable is not defined

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. create a python file like this:
    #%%
    print(__file__)
  2. click Run Cell
    • it should print the file path correctly
  3. restart the kernel from the Restart button in the interactive window
  4. run the cell again
    • a NameError exception is raised for __file__
@elazarcoh elazarcoh added the bug Issue identified by VS Code Team member as probable bug label Oct 11, 2021
@DonJayamanne DonJayamanne added regression candidate Issue identified as probable candidate for fixing in the next release labels Oct 11, 2021
@DonJayamanne DonJayamanne self-assigned this Oct 11, 2021
@DonJayamanne DonJayamanne added the interactive-window Impacts interactive window label Oct 11, 2021
@DonJayamanne DonJayamanne added this to the October 2021 Recovery milestone Oct 12, 2021
@DonJayamanne
Copy link
Contributor

@elazarcoh this has been fixed and it will be available in tomorrows build of VS Code insiders.
Will look into getting this into a hotfix release

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 13, 2022
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 candidate Issue identified as probable candidate for fixing in the next release interactive-window Impacts interactive window
Projects
None yet
Development

No branches or pull requests

2 participants