summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk Mallunat <s4msung@exigen.org>2016-07-08 20:36:30 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-07-08 20:47:31 +0200
commit74af7b06ba8ff2f1953816fe64fc9fa76148f3d5 (patch)
treedb1838f70c468f64c5d75b85e59775da869ccf6c
parent977392aadcb8efea7d00c248f380ef361a7df1f9 (diff)
read binary from stdin
-rwxr-xr-xfb.py4
1 files 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: