mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-24 13:05:50 +00:00
Handle Python 3 case where stdout by default is Unicode.
This commit is contained in:
parent
e6532305bf
commit
2554112045
@ -30,6 +30,10 @@ def get(options):
|
||||
outf = open(to_file, "wb")
|
||||
else:
|
||||
outf = stdout
|
||||
# Make sure we can write bytes; on Python 3 stdout is Unicode by
|
||||
# default.
|
||||
if getattr(outf, "encoding", None) is not None:
|
||||
outf = outf.buffer
|
||||
while True:
|
||||
data = resp.read(4096)
|
||||
if not data:
|
||||
|
Loading…
x
Reference in New Issue
Block a user