Skip to content

New REPL omits local variables when running ./python -i script.py #120798

Description

@vstinner

Bug report

Example script.py:

x = 1

Output:

$ ./python -i script.py
>>> x
NameError: name 'x' is not defined

Using the basic REPL, it works as expected:

$ PYTHON_BASIC_REPL=1 ./python -i script.py
>>> x
1

cc @pablogsal @ambv @lysnikolaou

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    topic-replRelated to the interactive shell
    on Jun 20, 2024
  2. eryksun commented on Jun 20, 2024

    @eryksun
    Contributor

    This is a duplicate of #120678.

  3. vstinner commented on Jun 20, 2024

    @vstinner
    MemberAuthor

    This is a duplicate of #120678.

    Oh right! I close my issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions