]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-73458: Fix logging.config.listen() on a host without an IPv4 address (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 24 Jul 2026 15:28:11 +0000 (17:28 +0200)
committerGitHub <noreply@github.com>
Fri, 24 Jul 2026 15:28:11 +0000 (15:28 +0000)
commit2cb04b90290df2c6a6fce4fdeb8e94f434e3a90c
tree5284905cd3d600de5057861706a0831f1182b15b
parent0e8b607a3aee3074d81de9bddabfa1383199f2ed
[3.14] gh-73458: Fix logging.config.listen() on a host without an IPv4 address (GH-154491) (GH-154617)

The server is created in a thread which set the "ready" event only after a
successful start, so a failure to start left the caller waiting for that
event forever.  Set it also on failure.

The receiver always used AF_INET, which fails if the host has no IPv4
address, for example if "localhost" is only aliased to ::1.  Use the family
of the first resolved address in such case.

Also fixes gh-82076.
(cherry picked from commit 45a10f5d711ebe1bce9c6b93c10bbc5fe5bdf392)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Lib/logging/config.py
Lib/test/test_logging.py
Misc/NEWS.d/next/Library/2026-07-22-13-01-24.gh-issue-73458.byxSPi.rst [new file with mode: 0644]