This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: SysLogHandler does not support IPv6 destinations
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.7, Python 3.6, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: calcheng, vinay.sajip, xiang.zhang
Priority: normal Keywords:

Created on 2017-05-16 14:23 by calcheng, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_syslog.py calcheng, 2017-05-16 14:23 Test script for syslog
Pull Requests
URL Status Linked Edit
PR 1676 merged xiang.zhang, 2017-05-20 07:45
PR 1902 merged xiang.zhang, 2017-06-01 13:25
PR 1903 merged xiang.zhang, 2017-06-01 13:26
PR 1904 merged xiang.zhang, 2017-06-01 13:42
Messages (6)
msg293764 - (view) Author: calcheng (calcheng) * Date: 2017-05-16 14:23
The attached test script works fine with IPv4 syslog:
$ python test_syslog.py 192.168.1.4
(no errors reported)

When running the attached script with python 3.5.2 on Ubuntu 16.04, received the following error:

$ python3 test_syslog.py ::1
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.5/logging/handlers.py", line 908, in emit
    self.socket.sendto(msg, self.address)
socket.gaierror: [Errno -9] Address family for hostname not supported
Call stack:
  File "test_syslog.py", line 16, in <module>
    logging.info("Test Syslog with IPv6")
Message: 'Test Syslog with IPv6'
Arguments: ()

Similar error in python 2.7.10:

$ python test_syslog.py ::1
Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/handlers.py", line 864, in emit
    self.socket.sendto(msg, self.address)
gaierror: [Errno -9] Address family for hostname not supported
Logged from file test_syslog.py, line 16
msg294936 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-06-01 13:12
New changeset 0b4b57df964f1ba427684556b8e5f05852454e0d by Xiang Zhang in branch 'master':
bpo-30378: Fix the problem that SysLogHandler can't handle IPv6 addresses (#1676)
https://github.com/python/cpython/commit/0b4b57df964f1ba427684556b8e5f05852454e0d
msg294945 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-06-01 14:20
New changeset e20d22671996712eac416dd7bda79b5344d81164 by Xiang Zhang in branch '3.5':
bpo-30378: Fix the problem that SysLogHandler can't handle IPv6 addresses (#1676) (#1902)
https://github.com/python/cpython/commit/e20d22671996712eac416dd7bda79b5344d81164
msg294946 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-06-01 14:20
New changeset 95b4da2be4aeb74ee46ddece71f2075b32915c60 by Xiang Zhang in branch '3.6':
bpo-30378: Fix the problem that SysLogHandler can't handle IPv6 addresses (#1676) (#1903)
https://github.com/python/cpython/commit/95b4da2be4aeb74ee46ddece71f2075b32915c60
msg294947 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-06-01 14:22
New changeset 3ef3bcbe38e1913119c3022ca470d06908eeda3c by Xiang Zhang in branch '2.7':
bpo-30378: Fix the problem that SysLogHandler can't handle IPv6 addresses (#1904) (#1676)
https://github.com/python/cpython/commit/3ef3bcbe38e1913119c3022ca470d06908eeda3c
msg294948 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-06-01 14:24
Thanks calcheng for your report and Vinay for the review.
History
Date User Action Args
2022-04-11 14:58:46adminsetgithub: 74563
2017-06-01 14:24:10xiang.zhangsetstatus: open -> closed
versions: + Python 2.7, Python 3.6, Python 3.7
messages: + msg294948

resolution: fixed
stage: resolved
2017-06-01 14:22:20xiang.zhangsetmessages: + msg294947
2017-06-01 14:20:30xiang.zhangsetmessages: + msg294946
2017-06-01 14:20:01xiang.zhangsetmessages: + msg294945
2017-06-01 13:42:37xiang.zhangsetpull_requests: + pull_request1983
2017-06-01 13:26:14xiang.zhangsetpull_requests: + pull_request1982
2017-06-01 13:25:51xiang.zhangsetpull_requests: + pull_request1981
2017-06-01 13:12:00xiang.zhangsetmessages: + msg294936
2017-05-20 07:49:31xiang.zhangsetnosy: + vinay.sajip, xiang.zhang
2017-05-20 07:45:54xiang.zhangsetpull_requests: + pull_request1771
2017-05-16 17:20:46Calvin Chengsetnosy: + calcheng, - Calvin Cheng
2017-05-16 17:20:14Calvin Chengsetnosy: + Calvin Cheng, - calcheng
2017-05-16 14:23:19calchengcreate