]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35046: do only one system call per line (logging.StreamHandler) (GH-10042) (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 23 Oct 2018 10:07:06 +0000 (03:07 -0700)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Tue, 23 Oct 2018 10:07:06 +0000 (11:07 +0100)
(cherry picked from commit b7d62050e7d5fc208ae7673613da4f1f2bc565c4)

Lib/logging/__init__.py

index 3ad2cc38f61eca09fe853e3caf20b738d2c526e1..2761509d9951496cd794510590edc78f2cdb0ff1 100644 (file)
@@ -1033,8 +1033,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)