-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Open
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-asynciotopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
According to the documentation, all PYTHON* environment variables are ignored when -I is passed as a command-line option to Python.
Let's make the asyncio REPL comply with that by checking sys.flags.isolated before PYTHONSTARTUP.
#140288 rearranges and solidifies startup tests for any REPLs. It will help in testing this. Let's merge that PR first, and I'll submit a patch for this one shortly after.
Reproduction:
$ echo 'print("you should not be seeing this!")' > t.py
$ PYTHONSTARTUP=t.py ./python -Im asyncio
asyncio REPL 3.15.0a1+ (heads/main:06c779474c7, Oct 27 2025, 02:33:08) [GCC 15.2.1 20250808 (Red Hat 15.2.1-1)] on linux
Use "await" directly instead of "asyncio.run()".
Type "help", "copyright", "credits" or "license" for more information.
you should not be seeing this!
>>> import asyncio
>>>CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-asynciotopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Todo