[Python-checkins] cpython (3.2): Issue #15800: fix the closing of input / output files when gzip is used as a

antoine.pitrou python-checkins at python.org
Thu Aug 30 00:33:56 CEST 2012


http://hg.python.org/cpython/rev/0b5ba5f610a9
changeset:   78805:0b5ba5f610a9
branch:      3.2
parent:      78803:900b82193237
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Thu Aug 30 00:29:24 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
@@ -621,9 +621,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


More information about the Python-checkins mailing list