From: Antoine Pitrou Date: Wed, 29 Aug 2012 22:29:24 +0000 (+0200) Subject: Issue #15800: fix the closing of input / output files when gzip is used as a script. X-Git-Tag: v3.2.4rc1~581 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ecc4757b79c7d8f7b09fbc2e8b24258c22cfed12;p=thirdparty%2FPython%2Fcpython.git Issue #15800: fix the closing of input / output files when gzip is used as a script. --- diff --git a/Lib/gzip.py b/Lib/gzip.py index ee45e50ffbae..e1b43a55988a 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__':