summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_logging.py
diff options
context:
space:
mode:
authorKirill Pinchuk <192182+cybergrind@users.noreply.github.com>2021-08-05 13:58:16 (GMT)
committerGitHub <noreply@github.com>2021-08-05 13:58:16 (GMT)
commit3d315c311676888201f4a3576e4ee3698684a3a2 (patch)
treef9fd948febf5c5d077af5eb79ba977c42a4c8208 /Lib/test/test_logging.py
parent8f010dc920e1f6dc6a357e7cc1460a7a567c05c6 (diff)
downloadcpython-3d315c311676888201f4a3576e4ee3698684a3a2.zip
cpython-3d315c311676888201f4a3576e4ee3698684a3a2.tar.gz
cpython-3d315c311676888201f4a3576e4ee3698684a3a2.tar.bz2
bpo-44291: Fix reconnection in logging.handlers.SysLogHandler (GH-26490)
Diffstat (limited to 'Lib/test/test_logging.py')
-rw-r--r--Lib/test/test_logging.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index b3393d3..9998f1a 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -1942,6 +1942,14 @@ class SysLogHandlerTest(BaseTest):
self.handled.wait()
self.assertEqual(self.log_output, b'<11>h\xc3\xa4m-sp\xc3\xa4m')
+ def test_udp_reconnection(self):
+ logger = logging.getLogger("slh")
+ self.sl_hdlr.close()
+ self.handled.clear()
+ logger.error("sp\xe4m")
+ self.handled.wait(0.1)
+ self.assertEqual(self.log_output, b'<11>sp\xc3\xa4m\x00')
+
@unittest.skipUnless(hasattr(socket, "AF_UNIX"), "Unix sockets required")
class UnixSysLogHandlerTest(SysLogHandlerTest):