From ecc4757b79c7d8f7b09fbc2e8b24258c22cfed12 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Thu, 30 Aug 2012 00:29:24 +0200 Subject: [PATCH] Issue #15800: fix the closing of input / output files when gzip is used as a script. --- Lib/gzip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/gzip.py b/Lib/gzip.py index ee45e50ffba..e1b43a55988 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -621,9 +621,9 @@ def _test(): if not chunk: break g.write(chunk) - if g is not sys.stdout: + if g is not sys.stdout.buffer: g.close() - if f is not sys.stdin: + if f is not sys.stdin.buffer: f.close() if __name__ == '__main__':