Skip to content
Snippets Groups Projects
Commit 21700051 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Read/Write file in binary mode

parent fde2ac73
No related branches found
No related tags found
No related merge requests found
......@@ -146,7 +146,7 @@ class StateTransfering(JingleFileTransferStates):
def _start_ibb_transfer(self, con):
self.jft.file_props.transport_sid = self.jft.transport.sid
fp = open(self.jft.file_props.file_name, 'r')
fp = open(self.jft.file_props.file_name, 'rb')
con.OpenStream(self.jft.file_props.sid, self.jft.session.peerjid, fp,
blocksize=4096)
......
......@@ -251,7 +251,7 @@ class ConnectionBytestream:
if field.getValue() == nbxmpp.NS_IBB:
sid = file_props.sid
file_props.transport_sid = sid
fp = open(file_props.file_name, 'r')
fp = open(file_props.file_name, 'rb')
self.OpenStream(sid, file_props.receiver, fp)
raise nbxmpp.NodeProcessed
......@@ -815,7 +815,7 @@ class ConnectionIBBytestream(ConnectionBytestream):
file_props.disconnect_cb = None
file_props.continue_cb = None
file_props.syn_id = stanza.getID()
file_props.fp = open(file_props.file_name, 'w')
file_props.fp = open(file_props.file_name, 'wb')
conn.send(rep)
def CloseIBBStream(self, file_props):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment