]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-79366: Fix a race condition when removing a logging handler (GH-154528) main
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 2 Aug 2026 10:15:56 +0000 (13:15 +0300)
committerGitHub <noreply@github.com>
Sun, 2 Aug 2026 10:15:56 +0000 (13:15 +0300)
commit083e0388b0a39d379ab0e7370e8dce7574a87171
treebcde06105354136b86c40b5378a263a2c5b9c735
parent96ebb20fc2f0542d9387091e49626f9a1132de82
gh-79366: Fix a race condition when removing a logging handler (GH-154528)

removeHandler() mutated the handler list in place, so if a handler was
removed while callHandlers() was iterating the same list, the following
handlers could be skipped.  Replace the list instead of mutating it.

Co-authored-by: Ben Spiller <11992588+ben-spiller@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Lib/logging/__init__.py
Lib/test/test_logging.py
Misc/NEWS.d/next/Library/2026-07-23-06-53-01.gh-issue-79366.3gMT7I.rst [new file with mode: 0644]