Skip to content

'PusherAsyncClient' object has no attribute 'connection' #2

Open
@ignacio-diaz

Description

@ignacio-diaz

Hi!

I have a problem and I don't know how to fix it..

when I try to subscrive to a public pusher, like
status = await pusherclient.subscribe(channel_name='prod-{}'.format(asdf))
print("Subscription Status: %s"%(status))

it works perfecly, but when I try to subscrive to a private channel, like this
status = await pusherclient.subscribe(channel_name='private-{}'.format(lalala))
print("Subscription Status: %s"%(status))

It sends me an error
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/nacho/.vscode/extensions/ms-python.python-2020.8.108011/pythonFiles/lib/python/debugpy/main.py", line 45, in
cli.main()
File "/home/nacho/.vscode/extensions/ms-python.python-2020.8.108011/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 430, in main
run()
File "/home/nacho/.vscode/extensions/ms-python.python-2020.8.108011/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 267, in run_file
runpy.run_path(options.target, run_name=compat.force_str("main"))
File "/usr/lib/python3.8/runpy.py", line 263, in run_path
return _run_module_code(code, init_globals, run_name,
File "/usr/lib/python3.8/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/nacho/Escritorio/PyOx/trades/orionTrades.py", line 122, in
loop.run_until_complete(bitstamp_ob_subscription(loop))
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/nacho/Escritorio/PyOx/trades/orionTrades.py", line 93, in bitstamp_ob_subscription
status = await pusherclient.subscribe(channel_name='private-{}'.format(lalala))
File "/home/nacho/.local/lib/python3.8/site-packages/pysherasync/pysherasync.py", line 78, in subscribe
data['auth'] = self._generate_auth_token(channel_name)
File "/home/nacho/.local/lib/python3.8/site-packages/pysherasync/pysherasync.py", line 114, in _generate_auth_token
subject = "{}:{}".format(self.connection.socket_id, channel_name)
AttributeError: 'PusherAsyncClient' object has no attribute 'connection'

What am I missing?

Regards!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions