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

PYTHON_BASIC_REPL is ignored by interactive inspect #120346

Closed
eryksun opened this issue Jun 11, 2024 · 2 comments
Closed

PYTHON_BASIC_REPL is ignored by interactive inspect #120346

eryksun opened this issue Jun 11, 2024 · 2 comments
Assignees
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes topic-repl Related to the interactive shell triaged The issue has been accepted as valid by a triager. type-bug An unexpected behavior, bug, or error

Comments

@eryksun
Copy link
Contributor

eryksun commented Jun 11, 2024

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

@eryksun eryksun added type-bug An unexpected behavior, bug, or error triaged The issue has been accepted as valid by a triager. topic-repl Related to the interactive shell labels Jun 11, 2024
@AlexWaygood AlexWaygood added 3.13 bugs and security fixes 3.14 new features, bugs and security fixes labels Jun 11, 2024
@pablogsal
Copy link
Member

On it

pablogsal added a commit to pablogsal/cpython that referenced this issue Jun 11, 2024
pablogsal added a commit to pablogsal/cpython that referenced this issue Jun 11, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 11, 2024
…e inspect mode (pythonGH-120349)

(cherry picked from commit ec3af29)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
lysnikolaou pushed a commit that referenced this issue Jun 11, 2024
…ve inspect mode (GH-120349) (#120351)

(cherry picked from commit ec3af29)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
@pablogsal
Copy link
Member

Fixed!

mrahtz pushed a commit to mrahtz/cpython that referenced this issue Jun 30, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes topic-repl Related to the interactive shell triaged The issue has been accepted as valid by a triager. type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants