diff --git a/src/allmydata/scripts/tahoe_get.py b/src/allmydata/scripts/tahoe_get.py index b934f54b8..769a366a5 100644 --- a/src/allmydata/scripts/tahoe_get.py +++ b/src/allmydata/scripts/tahoe_get.py @@ -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: