summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-01-04 21:11:10 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2009-01-04 21:11:10 (GMT)
commit9d625c26c0c9610f9ddeaa69b09501da9bed1c3b (patch)
treeecfb349f7295cb921bfecfd9cf5569260ea95166
parentd6d63f543796c48fd9a1f297b860287443687d2e (diff)
downloadcpython-9d625c26c0c9610f9ddeaa69b09501da9bed1c3b.zip
cpython-9d625c26c0c9610f9ddeaa69b09501da9bed1c3b.tar.gz
cpython-9d625c26c0c9610f9ddeaa69b09501da9bed1c3b.tar.bz2
Buglet: restore functioning of gzip as an executable when (de)compressing from stdin to stdout
-rw-r--r--Lib/gzip.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/gzip.py b/Lib/gzip.py
index 9d8dac5..11d5571 100644
--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -473,8 +473,8 @@ def _test():
for arg in args:
if decompress:
if arg == "-":
- f = GzipFile(filename="", mode="rb", fileobj=sys.stdin)
- g = sys.stdout
+ f = GzipFile(filename="", mode="rb", fileobj=sys.stdin.buffer)
+ g = sys.stdout.buffer
else:
if arg[-3:] != ".gz":
print("filename doesn't end in .gz:", repr(arg))
@@ -483,8 +483,8 @@ def _test():
g = builtins.open(arg[:-3], "wb")
else:
if arg == "-":
- f = sys.stdin
- g = GzipFile(filename="", mode="wb", fileobj=sys.stdout)
+ f = sys.stdin.buffer
+ g = GzipFile(filename="", mode="wb", fileobj=sys.stdout.buffer)
else:
f = builtins.open(arg, "rb")
g = open(arg + ".gz", "wb")