cpython (merge 3.2 -> default): Issue #15800: fix the closing of input / output files when gzip is used as a

http://hg.python.org/cpython/rev/be505d22dde8 changeset: 78806:be505d22dde8 parent: 78804:4a37bed5b96f parent: 78805:0b5ba5f610a9 user: Antoine Pitrou <solipsis@pitrou.net> date: Thu Aug 30 00:30:14 2012 +0200 summary: Issue #15800: fix the closing of input / output files when gzip is used as a script. files: Lib/gzip.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/gzip.py b/Lib/gzip.py --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -670,9 +670,9 @@ 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__': -- Repository URL: http://hg.python.org/cpython
participants (1)
-
antoine.pitrou