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

New REPL exposes its internal imports/definitions to top-level environment #118908

Open
chgnrdv opened this issue May 10, 2024 · 1 comment
Open
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error

Comments

@chgnrdv
Copy link
Contributor

chgnrdv commented May 10, 2024

Bug report

Bug description:

Top-level scope now contains globals of _pyrepl.__main__:

Python 3.14.0a0 (heads/main:a895756aec, May 10 2024, 16:56:55) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> dir()
['CAN_USE_PYREPL', '__annotations__', '__builtins__', '__cached__', '__doc__', '__file__',
'__loader__', '__name__', '__package__', '__spec__', 'interactive_console', 'os', 'sys']

CPython versions tested on:

3.13

Operating systems tested on:

Linux

@chgnrdv chgnrdv added the type-bug An unexpected behavior, bug, or error label May 10, 2024
@hugovk hugovk added topic-repl Related to the interactive shell 3.13 bugs and security fixes 3.14 new features, bugs and security fixes labels May 10, 2024
@chgnrdv
Copy link
Contributor Author

chgnrdv commented May 10, 2024

Refs #111201

I can submit a PR when decision will be made about how to fix it. Possible solution is to move __main__.py contents to __init__.py or special _pyrepl submodule and import interactive_console to __main__.

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 type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants