bpo-35046: do only one system call per line (logging.StreamHandler) (GH-10042)
authorJosh Snyder <hashbrowncipher@users.noreply.github.com>
Tue, 23 Oct 2018 06:48:38 +0000 (23:48 -0700)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Tue, 23 Oct 2018 06:48:38 +0000 (07:48 +0100)
Lib/logging/__init__.py

index 58afcd29c90a0a4339059ee7c652995ea42cd703..b4659af7cc985f7961b7d30fbc053202d0a32a5e 100644 (file)
@@ -1091,8 +1091,8 @@ class StreamHandler(Handler):
         try:
             msg = self.format(record)
             stream = self.stream
-            stream.write(msg)
-            stream.write(self.terminator)
+            # issue 35046: merged two stream.writes into one.
+            stream.write(msg + self.terminator)
             self.flush()
         except Exception:
             self.handleError(record)