pusher/pusher-http-python

tornado_channel still broken in branch 0.8

nullco opened this issue · 1 comments

Hey folks, it seems that the fix that resolves the tornado channel issue isnt reflected when installing version 0.8 via PIP

pip install pusher==0.8
cat /usr/local/lib/python2.7/dist-packages/pusher/init.py

result:

class  TornadoChannel(Channel):
    def trigger(self, event, data={}, socket_id=None, callback=None):
        self.callback = callback
        return super(TornadoChannel, self).trigger(event, data, socket_id)

    def send_request(self, signed_path, data_string):
        import tornado.httpclient
        absolute_url = self.get_absolute_path(signed_path)
        request = tornado.httpclient.HTTPRequest(absolute_url, method='POST', body=data_string)
        client = tornado.httpclient.AsyncHTTPClient()
        client.fetch(request, callback=self.callback)
        # Returning 202 to avoid Channel errors. Actual error handling takes place in callback.
        return 202, ""

If its compared to what its actually in github, it differs

class TornadoChannel(Channel):
    def trigger(self, event, data={}, socket_id=None, callback=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
        self.callback = callback
        return super(TornadoChannel, self).trigger(event, data, socket_id, timeout=timeout)

    def send_request(self, signed_path, data_string, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
        timeout = None if timeout == socket._GLOBAL_DEFAULT_TIMEOUT else timeout
        import tornado.httpclient
        absolute_url = self.get_absolute_path(signed_path)
        request = tornado.httpclient.HTTPRequest(absolute_url, method='POST', body=data_string, request_timeout=timeout)
        client = tornado.httpclient.AsyncHTTPClient()
        client.fetch(request, callback=self.callback)
        # Returning 202 to avoid Channel errors. Actual error handling takes place in callback.
        return 202, ""

As i see, it just needs to be pushed to the PIP repos

Thanks for reporting this. I'm closing this issue due to the library now being many versions ahead.