From 30acd951e4c95f539ac9a2e2759280c5fdb50412 Mon Sep 17 00:00:00 2001 From: Josh Snyder Date: Mon, 22 Oct 2018 23:48:38 -0700 Subject: [PATCH] bpo-35046: do only one system call per line (logging.StreamHandler) (GH-10042) (cherry picked from commit b7d62050e7d5fc208ae7673613da4f1f2bc565c4) Co-authored-by: Josh Snyder --- Lib/logging/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 3ad2cc38f61eca0..2761509d9951496 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -1033,8 +1033,8 @@ def emit(self, record): 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)