Read/Write file in binary mode
This commit is contained in:
parent
fde2ac731b
commit
21700051f8
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue