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
{{ message }}
Repository navigation
test_logging hangs if /etc/hosts only aliases "localhost" to ::1 #73458
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2017-01-14.01:37:00.339>labels= ['type-bug', 'tests']
title='test_logging hangs if /etc/hosts only aliases "localhost" to ::1'updated_at=<Date2018-07-02.13:32:07.214>user='https://bugs.python.org/phantal'
On some of the linux boxes on our (air-gapped, if that matters) network it looks like some of them were mis-configured and their /etc/hosts file looks something like this:
It appears this is causing test_logging to hang while running SocketHandlerTest.
Unfortunately I don't have administrative privileges so I'm not able to prove I'm right. I only have circumstantial evidence, but no machine I tested (about 20 machines) contradicts what I stated above.
Activity
phantal commentedon Jan 14, 2017
On some of the linux boxes on our (air-gapped, if that matters) network it looks like some of them were mis-configured and their /etc/hosts file looks something like this:
... whereas for other linux machines not exhibiting this problem:
It appears this is causing test_logging to hang while running SocketHandlerTest.
Unfortunately I don't have administrative privileges so I'm not able to prove I'm right. I only have circumstantial evidence, but no machine I tested (about 20 machines) contradicts what I stated above.
KMiNT21 commentedon May 31, 2018
The same bug for me:
3.6.5 and 3.6.4 -hangs on test_logging forever.
Thanks to this report - I've commented some lines in /etc/host
and after 'test_logging' passed OK!
vstinner commentedon Jul 2, 2018
I confirm the issue. test_logging hangs if the resolution of the hostname fails with a timeout.
I worked around the issue by adding my hostname to /etc/hosts.
serhiy-storchaka commentedon Jul 22, 2026
Should be fixed by #154491.
gh-73458: Fix logging.config.listen() on a host without an IPv4 addre…
[3.13] gh-73458: Fix logging.config.listen() on a host without an IPv…
[3.14] gh-73458: Fix logging.config.listen() on a host without an IPv…
[3.15] gh-73458: Fix logging.config.listen() on a host without an IPv…
pythongh-73458: Fix logging.config.listen() on a host without an IPv4…