Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Bug description:
If I have a module calledfoo.py with the following contents in the root of my CPython local clone:
classFoo:pass
Then runningPYTHON_BASIC_REPL=1 ./python.exe -i foo.py, I get the following behaviour:foo.py is executed, and theFoo class is available in the globals of the REPL:
~/dev/cpython (main)⚡ % PYTHON_BASIC_REPL=1 ./python.exe -i foo.py >>> Foo<class '__main__.Foo'>
But with the new REPL, theFoo class isn't available!
~/dev/cpython (main)⚡ % ./python.exe -i foo.py >>> FooTraceback (most recent call last): File "<python-input-0>", line 1, in <module> FooNameError: name 'Foo' is not defined>>>
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
- gh-120678: pyrepl: Include globals from modules passed with
-i#120904 - [3.13] gh-120678: pyrepl: Include globals from modules passed with
-i(GH-120904) #121916 - gh-120678: Guard against stdin.fileno() being unavailable #121924
- [3.13] gh-120678: Guard against stdin.fileno() being unavailable (GH-121924) #121929