From 74af7b06ba8ff2f1953816fe64fc9fa76148f3d5 Mon Sep 17 00:00:00 2001 From: Dirk Mallunat Date: Fri, 8 Jul 2016 20:36:30 +0200 Subject: read binary from stdin --- fb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fb.py b/fb.py index f1c39e2..acfc3e6 100755 --- a/fb.py +++ b/fb.py @@ -662,9 +662,9 @@ class FBClient: tempfile = os.path.join(self.tempdir, os.path.basename(self.args.name)) if sys.stdin.isatty(): print("^C to exit, ^D to send") - f = open(tempfile, "w") + f = open(tempfile, "wb") try: - f.write(sys.stdin.read()) + f.write(sys.stdin.buffer.read()) except KeyboardInterrupt: sys.exit(130) finally: -- cgit v1.2.3-24-g4f1b