Comment 1 for bug 1458651

Revision history for this message
Tim Landscheidt (scfc) wrote :

Tested with script from https://wikitech.wikimedia.org/wiki/RCStream#Python:

import socketIO_client

class WikiNamespace(socketIO_client.BaseNamespace):
    def on_change(self, change):
        print('%(user)s edited %(title)s' % change)

    def on_connect(self):
        self.emit('subscribe', 'commons.wikimedia.org')

socketIO = socketIO_client.SocketIO('stream.wikimedia.org', 80)
socketIO.define(WikiNamespace, '/rc')

socketIO.wait()

This works on Trusty, but on Precise it fails with:

scfc@toolsbeta-test-precise:~$ bin/socketio_client-test.py
Traceback (most recent call last):
  File "bin/socketio_client-test.py", line 13, in <module>
    socketIO = socketIO_client.SocketIO('stream.wikimedia.org', 80)
  File "/usr/lib/python2.7/dist-packages/socketIO_client/__init__.py", line 136, in __init__
    self.define(Namespace)
  File "/usr/lib/python2.7/dist-packages/socketIO_client/__init__.py", line 150, in define
    namespace = Namespace(self._transport, path)
  File "/usr/lib/python2.7/dist-packages/socketIO_client/__init__.py", line 237, in _transport
    self.__transport = self._get_transport()
  File "/usr/lib/python2.7/dist-packages/socketIO_client/__init__.py", line 251, in _get_transport
    self.is_secure, self.base_url, **self.kw)
  File "/usr/lib/python2.7/dist-packages/socketIO_client/__init__.py", line 402, in _get_socketIO_session
    response_parts = response.text.split(':')
AttributeError: 'Response' object has no attribute 'text'
Exception AttributeError: "'SocketIO' object has no attribute '_SocketIO__transport'" in <bound method SocketIO.__del__ of <socketIO_client.SocketIO object at 0x7f234dddd4d0>> ignored
scfc@toolsbeta-test-precise:~$

This is probably due to python-requests being 0.8.2 in Precise and 2.2.1 in Trusty.