-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
Make asyncio REPL respect python -E #149319
Copy link
Copy link
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-asynciotopic-replRelated to the interactive shellRelated to the interactive shelltype-featureA feature request or enhancementA feature request or enhancement
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-asynciotopic-replRelated to the interactive shellRelated to the interactive shelltype-featureA feature request or enhancementA feature request or enhancement
Projects
Status
Todo
Feature or enhancement
Proposal:
To my knowledge,
python -Easks the interpreter to ignore all documented environment variables starting with thePYTHONprefix that might be set. The REPL ofasyncio, however, does not follow this:sys.flags.ignore_environment, before looking atPYTHON_BASIC_REPL.PYTHONSTARTUPis guarded by asys.flag.isolatedcheck (-I) as opposed tosys.flags.ignore_environment(-E). Is this a flaw in the documentation? I think it makes sense to special-casePYTHONSTARTUP.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
Links to previous discussion of this feature:
No response