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

sys.ps1 and sys.ps2 should be reverted after code.interact #130660

Closed
gaogaotiantian opened this issue Feb 28, 2025 · 2 comments
Closed

sys.ps1 and sys.ps2 should be reverted after code.interact #130660

gaogaotiantian opened this issue Feb 28, 2025 · 2 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@gaogaotiantian
Copy link
Member

gaogaotiantian commented Feb 28, 2025

Bug report

Bug description:

Our documentation clearly states that sys.ps1 and sys.ps2 are only defined when the interpreter is in interactive mode. code.interact brings the interpreter to interactive mode, but after the function the interpreter is not in that mode anymore. Therefore, we should not keep sys.ps1 and sys.ps2 because that could mislead programs to think the interpreter is still in interactive mode.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

@encukou
Copy link
Member

encukou commented Mar 19, 2025

Triage: Is there anything more to do for this issue?

@gaogaotiantian
Copy link
Member Author

It's finished. Thanks for find this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants