You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To my knowledge, python -E asks the interpreter to ignore all documented environment variables starting with the PYTHON prefix that might be set. The REPL of asyncio, however, does not follow this:
It does not include a conditional checking sys.flags.ignore_environment, before looking at PYTHON_BASIC_REPL.
Executing PYTHONSTARTUP is guarded by a sys.flag.isolated check (-I) as opposed to sys.flags.ignore_environment (-E). Is this a flaw in the documentation? I think it makes sense to special-case PYTHONSTARTUP.
See the relevant portions of the code here and here, and the documentation part here.
I am making this a feature, because I am not sure if the second part is a bug or intended, in which case it is a documentation fault.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Activity
picnixz commentedon May 3, 2026
cc @ambv @pablogsal @kumaraditya303 (strictly speaking, not totally asyncio but still asyncio-related)
jonathandung commentedon Jun 25, 2026
Can this be re-labelled as a bug?
gh-149319: Make `asyncio` REPL respect `-I` and `-E` options (#149405)
terryjreedy commentedon Jul 19, 2026
If this is really a bug rather than feature issue, should the PR be backported?
picnixz commentedon Jul 19, 2026
Yes, I think it should be treated as a bug.
[3.15] gh-149319: Make `asyncio` REPL respect `-I` and `-E` options (G…
[3.13] gh-149319: Make `asyncio` REPL respect `-I` and `-E` options (G…
[3.14] gh-149319: Make `asyncio` REPL respect `-I` and `-E` options (G…