Merge branch 'master' of git://github.com/fritzy/SleekXMPP into develop

# By Lance Stout
# Via Lance Stout
* 'master' of git://github.com/fritzy/SleekXMPP:
  Turns out not all data is UTF-8, so don't try to decode it.
This commit is contained in:
Joe Hildebrand 2012-10-31 12:49:33 -06:00
commit 48def71d0c
3 changed files with 16 additions and 16 deletions

View File

@ -85,7 +85,7 @@ class IBBReceiver(sleekxmpp.ClientXMPP):
def stream_opened(self, stream):
# NOTE: IBB streams are bi-directional, so the original sender is
# now the opened stream's receiver.
print('Stream opened: %s from ' % (stream.sid, stream.receiver))
print('Stream opened: %s from %s' % (stream.sid, stream.receiver))
# You could run a loop reading from the stream using stream.recv(),
# or use the ibb_stream_data event.

View File

@ -14,7 +14,7 @@ def to_b64(data):
def from_b64(data):
return bytes(base64.b64decode(bytes(data))).decode('utf-8')
return bytes(base64.b64decode(bytes(data)))
class Open(ElementBase):

View File

@ -174,7 +174,7 @@ class TestInBandByteStreams(SleekTest):
to="tester@localhost/receiver" />
""")
self.assertEqual(data, ['it works!'])
self.assertEqual(data, [b'it works!'])
suite = unittest.TestLoader().loadTestsFromTestCase(TestInBandByteStreams)