diff -r e281a57d5b29 Lib/logging/handlers.py --- a/Lib/logging/handlers.py Tue Apr 19 08:53:14 2016 +0200 +++ b/Lib/logging/handlers.py Tue Apr 19 09:26:46 2016 +0200 @@ -810,7 +810,7 @@ self.facility = facility self.socktype = socktype - if isinstance(address, str): + if isinstance(address, (str, bytes)): self.unixsocket = True self._connect_unixsocket(address) else: diff -r e281a57d5b29 Lib/test/test_logging.py --- a/Lib/test/test_logging.py Tue Apr 19 08:53:14 2016 +0200 +++ b/Lib/test/test_logging.py Tue Apr 19 09:26:46 2016 +0200 @@ -1619,6 +1619,24 @@ SysLogHandlerTest.tearDown(self) os.remove(self.address) +@unittest.skipUnless(hasattr(socket, "AF_UNIX"), "Unix sockets required") +@unittest.skipUnless(threading, 'Threading required for this test.') +@unittest.skipUnless(sys.platform == 'linux', 'Linux specific test') +class UnixSysLogAbstractNamespaceHandlerTest(SysLogHandlerTest): + + """Test for SysLogHandler with Unix sockets in the abstract namespace.""" + + if threading and hasattr(socket, "AF_UNIX"): + server_class = TestUnixDatagramServer + + def setUp(self): + # override the definition in the base class + self.address = '\x00python_logging_test' + SysLogHandlerTest.setUp(self) + + def tearDown(self): + SysLogHandlerTest.tearDown(self) + @unittest.skipUnless(threading, 'Threading required for this test.') class HTTPHandlerTest(BaseTest): """Test for HTTPHandler.""" @@ -4187,7 +4205,7 @@ ExceptionTest, SysLogHandlerTest, HTTPHandlerTest, NTEventLogHandlerTest, TimedRotatingFileHandlerTest, UnixSocketHandlerTest, UnixDatagramHandlerTest, UnixSysLogHandlerTest, - MiscTestCase) + UnixSysLogAbstractNamespaceHandlerTest, MiscTestCase) if __name__ == "__main__": test_main()