Buglet: restore functioning of gzip as an executable when (de)compressing from stdin to stdout
This commit is contained in:
parent
d6d63f5437
commit
9d625c26c0
|
@ -473,8 +473,8 @@ def _test():
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if decompress:
|
if decompress:
|
||||||
if arg == "-":
|
if arg == "-":
|
||||||
f = GzipFile(filename="", mode="rb", fileobj=sys.stdin)
|
f = GzipFile(filename="", mode="rb", fileobj=sys.stdin.buffer)
|
||||||
g = sys.stdout
|
g = sys.stdout.buffer
|
||||||
else:
|
else:
|
||||||
if arg[-3:] != ".gz":
|
if arg[-3:] != ".gz":
|
||||||
print("filename doesn't end in .gz:", repr(arg))
|
print("filename doesn't end in .gz:", repr(arg))
|
||||||
|
@ -483,8 +483,8 @@ def _test():
|
||||||
g = builtins.open(arg[:-3], "wb")
|
g = builtins.open(arg[:-3], "wb")
|
||||||
else:
|
else:
|
||||||
if arg == "-":
|
if arg == "-":
|
||||||
f = sys.stdin
|
f = sys.stdin.buffer
|
||||||
g = GzipFile(filename="", mode="wb", fileobj=sys.stdout)
|
g = GzipFile(filename="", mode="wb", fileobj=sys.stdout.buffer)
|
||||||
else:
|
else:
|
||||||
f = builtins.open(arg, "rb")
|
f = builtins.open(arg, "rb")
|
||||||
g = open(arg + ".gz", "wb")
|
g = open(arg + ".gz", "wb")
|
||||||
|
|
Loading…
Reference in New Issue