From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 23 Oct 2018 10:07:06 +0000 (-0700) Subject: bpo-35046: do only one system call per line (logging.StreamHandler) (GH-10042) (GH... X-Git-Tag: v3.7.2rc1~243 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d730719b094cb006711b1cd546927b863c173b31;p=thirdparty%2FPython%2Fcpython.git bpo-35046: do only one system call per line (logging.StreamHandler) (GH-10042) (GH-10050) (cherry picked from commit b7d62050e7d5fc208ae7673613da4f1f2bc565c4) --- diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 3ad2cc38f61e..2761509d9951 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -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)