force 'wb' mode for gzipfile
This commit is contained in:
parent
88adc08259
commit
e0939049dd
@ -130,7 +130,7 @@ def writefile(
|
|||||||
with tmpfile(path) as base_stream:
|
with tmpfile(path) as base_stream:
|
||||||
streams: Tuple[Any, ...] = (base_stream,)
|
streams: Tuple[Any, ...] = (base_stream,)
|
||||||
if path.suffix == '.gz':
|
if path.suffix == '.gz':
|
||||||
gz_stream = cast(IO[bytes], gzip.GzipFile(filename='', mtime=0, fileobj=base_stream))
|
gz_stream = cast(IO[bytes], gzip.GzipFile(filename='', mtime=0, fileobj=base_stream, mode='wb'))
|
||||||
streams = (gz_stream,) + streams
|
streams = (gz_stream,) + streams
|
||||||
else:
|
else:
|
||||||
gz_stream = base_stream
|
gz_stream = base_stream
|
||||||
|
@ -145,7 +145,7 @@ def writefile(
|
|||||||
with tmpfile(path) as base_stream:
|
with tmpfile(path) as base_stream:
|
||||||
streams: Tuple[Any, ...] = (base_stream,)
|
streams: Tuple[Any, ...] = (base_stream,)
|
||||||
if path.suffix == '.gz':
|
if path.suffix == '.gz':
|
||||||
stream = cast(IO[bytes], gzip.GzipFile(filename='', mtime=0, fileobj=base_stream))
|
stream = cast(IO[bytes], gzip.GzipFile(filename='', mtime=0, fileobj=base_stream, mode='wb'))
|
||||||
streams = (stream,) + streams
|
streams = (stream,) + streams
|
||||||
else:
|
else:
|
||||||
stream = base_stream
|
stream = base_stream
|
||||||
|
@ -190,7 +190,7 @@ def writefile(
|
|||||||
with tmpfile(path) as base_stream:
|
with tmpfile(path) as base_stream:
|
||||||
streams: Tuple[Any, ...] = (base_stream,)
|
streams: Tuple[Any, ...] = (base_stream,)
|
||||||
if path.suffix == '.gz':
|
if path.suffix == '.gz':
|
||||||
stream = cast(IO[bytes], gzip.GzipFile(filename='', mtime=0, fileobj=base_stream))
|
stream = cast(IO[bytes], gzip.GzipFile(filename='', mtime=0, fileobj=base_stream, mode='wb'))
|
||||||
streams += (stream,)
|
streams += (stream,)
|
||||||
else:
|
else:
|
||||||
stream = base_stream
|
stream = base_stream
|
||||||
|
Loading…
Reference in New Issue
Block a user