Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python 3.10 AttributeError #48

Closed
pepebc opened this issue Jan 13, 2022 · 2 comments
Closed

python 3.10 AttributeError #48

pepebc opened this issue Jan 13, 2022 · 2 comments

Comments

@pepebc
Copy link

pepebc commented Jan 13, 2022

Everything was fine but with the python update to 3.10 this happens:

loop = asyncio.get_event_loop()
Traceback (most recent call last):
; File "/usr/lib/python3.10/site-packages/pysnmp/carrier/asyncio/dgram/base.py", line 93, in openClientMode
self._lport = getattr(asyncio, 'async')(c)
;AttributeError: module 'asyncio' has no attribute 'async'
caused by <class 'AttributeError'>: module 'asyncio' has no attribute 'async'
/home/pepe/bin/Brother/brother.py:15: RuntimeWarning: coroutine 'BaseEventLoop.create_datagram_endpoint' was never awaited
return
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

@paulbusse
Copy link

I had a similar experience. The package is used with Home Assistant and the error I got was

Traceback (most recent call last):
  File "/srv/ha/lib/python3.10/site-packages/homeassistant/data_entry_flow.py", line 203, in async_init
    flow, result = await task
  File "/srv/ha/lib/python3.10/site-packages/homeassistant/data_entry_flow.py", line 230, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data, init_done)
  File "/srv/ha/lib/python3.10/site-packages/homeassistant/data_entry_flow.py", line 325, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/srv/ha/lib/python3.10/site-packages/homeassistant/components/brother/config_flow.py", line 97, in async_step_zeroconf
    await self.brother.async_update()
  File "/srv/ha/lib/python3.10/site-packages/brother/__init__.py", line 99, in async_update
    if not (raw_data := await self._get_data()):
  File "/srv/ha/lib/python3.10/site-packages/brother/__init__.py", line 233, in _get_data
    await self._init_device()
  File "/srv/ha/lib/python3.10/site-packages/brother/__init__.py", line 303, in _init_device
    errindication, errstatus, errindex, _ = await hlapi.getCmd(*request_args, *oids)
  File "/usr/local/lib/python3.10/asyncio/coroutines.py", line 124, in coro
    res = func(*args, **kw)
  File "/srv/ha/lib/python3.10/site-packages/pysnmp/hlapi/asyncio/cmdgen.py", line 151, in getCmd
    addrName, paramsName = lcd.configure(
  File "/srv/ha/lib/python3.10/site-packages/pysnmp/hlapi/lcd.py", line 91, in configure
    transport = transportTarget.openClientMode()
  File "/srv/ha/lib/python3.10/site-packages/pysnmp/hlapi/transport.py", line 53, in openClientMode
    self.transport = self.protoTransport().openClientMode(self.iface)
  File "/srv/ha/lib/python3.10/site-packages/pysnmp/carrier/asyncio/dgram/base.py", line 96, in openClientMode
    raise error.CarrierError(';'.join(traceback.format_exception(*sys.exc_info())))
pysnmp.carrier.error.CarrierError: Traceback (most recent call last):
;  File "/srv/ha/lib/python3.10/site-packages/pysnmp/carrier/asyncio/dgram/base.py", line 93, in openClientMode
    self._lport = getattr(asyncio, 'async')(c)
;AttributeError: module 'asyncio' has no attribute 'async'
caused by <class 'AttributeError'>: module 'asyncio' has no attribute 'async'

@bieniu
Copy link
Owner

bieniu commented Mar 2, 2022

This problem is related to pysnmp module etingof/pysnmp#413

@bieniu bieniu closed this as completed Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants