-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Description
Bug report
Bug description:
In the wild, I've encountered situations where logging.shutdown
gets called more than once in a process.
The current implementation is called with logging._handlerList
by default, meaning that handlers can have their flush()
and close()
methods called more than once, which can cause bad things to happen if those handlers are not amenable to being closed more than once.
If logging.shutdown()
is processing logging._handlerList
, it should clear that list once it finished to prevent handlers having their flush()
and close()
methods called more than once.
CPython versions tested on:
3.12, CPython main branch
Operating systems tested on:
Linux, macOS
Linked PRs
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Projects
Status
No status