Skip to content

PYTHON_BASIC_REPL is ignored by interactive inspect #120346

Closed

Description

@eryksun

Bug report

Bug description:

The code in pymain_repl() in "Modules/main.c" needs to check _Py_GetEnv(config->use_environment, "PYTHON_BASIC_REPL"). Otherwise running with -i, or with PYTHONINSPECT set in the environment, ends up running the new REPL instead of the basic REPL after the command or script finishes.

cpython/Modules/main.c

Lines 545 to 550 in 02c1dff

if (!isatty(fileno(stdin))) {
PyCompilerFlags cf = _PyCompilerFlags_INIT;
int run = PyRun_AnyFileExFlags(stdin, "<stdin>", 0, &cf);
*exitcode = (run != 0);
return;
}

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    triagedThe issue has been accepted as valid by a triager.
    topic-replRelated to the interactive shell
    on Jun 11, 2024
  2. pablogsal commented on Jun 11, 2024

    @pablogsal
    Member

    On it

  3. added 3 commits that reference this issue on Jun 11, 2024
  4. added a commit that references this issue on Jun 11, 2024
  5. added a commit that references this issue on Jun 11, 2024
  6. pablogsal commented on Jun 11, 2024

    @pablogsal
    Member

    Fixed!

  7. added a commit that references this issue on Jun 30, 2024
  8. added a commit that references this issue on Jul 11, 2024
  9. added a commit that references this issue on Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

3.13only security fixes3.14bugs and security fixestopic-replRelated to the interactive shelltriagedThe issue has been accepted as valid by a triager.type-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions