On exit: NoneType can't be used in 'await' expression #3

Closed
opened 2024-12-31 13:47:59 +00:00 by ben · 0 comments
Owner

When exiting, this always happens:

During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/home/ben/projects/notflixbot/notflixbot/main.py", line 104, in main
    asyncio.run(
            <function run at 0x7f64b55a7a60>
     <module 'asyncio' from '/usr/lib/python3.9/asyncio/__init__.py'>

  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
                                  <coroutine object MatrixClient.catch.<locals>.inner at 0x7f64b19d77
c0>
                <function BaseEventLoop.run_until_complete at 0x7f64b4fa0dc0>
            <_UnixSelectorEventLoop running=True closed=False debug=False>
  File "/usr/lib/python3.9/asyncio/base_events.py", line 634, in run_until_complete
    self.run_forever()
         <function BaseEventLoop.run_forever at 0x7f64b4fa0d30>
     <_UnixSelectorEventLoop running=True closed=False debug=False>
  File "/usr/lib/python3.9/asyncio/base_events.py", line 601, in run_forever
    self._run_once()
         <function BaseEventLoop._run_once at 0x7f64b4fa38b0>
     <_UnixSelectorEventLoop running=True closed=False debug=False>
  File "/usr/lib/python3.9/asyncio/base_events.py", line 1905, in _run_once
    handle._run()
           <function Handle._run at 0x7f64b5066430>
     <Handle <TaskStepMethWrapper object at 0x7f64b193e880>()>
> File "/usr/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
                                        <member '_args' of 'Handle' objects>
                                    <Handle <TaskStepMethWrapper object at 0x7f64b193e880>()>
                         <member '_callback' of 'Handle' objects>
                     <Handle <TaskStepMethWrapper object at 0x7f64b193e880>()>
         <member '_context' of 'Handle' objects>
     <Handle <TaskStepMethWrapper object at 0x7f64b193e880>()>

  File "/home/ben/projects/notflixbot/notflixbot/matrix.py", line 31, in inner
    return await f(*args, **kwargs)
                           {}
                    (Namespace(subcmd='start', debug=False, config='config.json'), <notflixbot.config.
Config object at 0x7f64b19e2d60>)
                  <function async_main at 0x7f64b1cdaaf0>

  File "/home/ben/projects/notflixbot/notflixbot/main.py", line 79, in async_main
    logger.info(f"forgot room {args.forget_room}")
           <function Logger.info at 0x7f64b3d37820>
     <loguru.logger handlers=[(id=1, level=20, sink=<stderr>), (id=2, level=20, sink='notflixbot.log'),
 (id=3, level=20, sink='web...

  File "/home/ben/projects/notflixbot/notflixbot/matrix.py", line 73, in __aexit__
    await self.close()
               <function MatrixClient.close at 0x7f64b1cd58b0>
           <notflixbot.matrix.MatrixClient object at 0x7f64b19af790>

  File "/home/ben/projects/notflixbot/notflixbot/matrix.py", line 80, in close
    await self._socket.close()
                      <function _AsyncSocket.close at 0x7f64b4bc40d0>
               <zmq.asyncio.Socket(zmq.PAIR) at 0x7f64b19b1400 closed>
           <notflixbot.matrix.MatrixClient object at 0x7f64b19af790>

TypeError: object NoneType can't be used in 'await' expression

Also opened as ops/meta#1 and was halfway fixed with #2.

When exiting, this always happens: ```python3 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/ben/projects/notflixbot/notflixbot/main.py", line 104, in main asyncio.run( │ └ <function run at 0x7f64b55a7a60> └ <module 'asyncio' from '/usr/lib/python3.9/asyncio/__init__.py'> File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) │ │ └ <coroutine object MatrixClient.catch.<locals>.inner at 0x7f64b19d77 c0> │ └ <function BaseEventLoop.run_until_complete at 0x7f64b4fa0dc0> └ <_UnixSelectorEventLoop running=True closed=False debug=False> File "/usr/lib/python3.9/asyncio/base_events.py", line 634, in run_until_complete self.run_forever() │ └ <function BaseEventLoop.run_forever at 0x7f64b4fa0d30> └ <_UnixSelectorEventLoop running=True closed=False debug=False> File "/usr/lib/python3.9/asyncio/base_events.py", line 601, in run_forever self._run_once() │ └ <function BaseEventLoop._run_once at 0x7f64b4fa38b0> └ <_UnixSelectorEventLoop running=True closed=False debug=False> File "/usr/lib/python3.9/asyncio/base_events.py", line 1905, in _run_once handle._run() │ └ <function Handle._run at 0x7f64b5066430> └ <Handle <TaskStepMethWrapper object at 0x7f64b193e880>()> > File "/usr/lib/python3.9/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) │ │ │ │ │ └ <member '_args' of 'Handle' objects> │ │ │ │ └ <Handle <TaskStepMethWrapper object at 0x7f64b193e880>()> │ │ │ └ <member '_callback' of 'Handle' objects> │ │ └ <Handle <TaskStepMethWrapper object at 0x7f64b193e880>()> │ └ <member '_context' of 'Handle' objects> └ <Handle <TaskStepMethWrapper object at 0x7f64b193e880>()> File "/home/ben/projects/notflixbot/notflixbot/matrix.py", line 31, in inner return await f(*args, **kwargs) │ │ └ {} │ └ (Namespace(subcmd='start', debug=False, config='config.json'), <notflixbot.config. Config object at 0x7f64b19e2d60>) └ <function async_main at 0x7f64b1cdaaf0> File "/home/ben/projects/notflixbot/notflixbot/main.py", line 79, in async_main logger.info(f"forgot room {args.forget_room}") │ └ <function Logger.info at 0x7f64b3d37820> └ <loguru.logger handlers=[(id=1, level=20, sink=<stderr>), (id=2, level=20, sink='notflixbot.log'), (id=3, level=20, sink='web... File "/home/ben/projects/notflixbot/notflixbot/matrix.py", line 73, in __aexit__ await self.close() │ └ <function MatrixClient.close at 0x7f64b1cd58b0> └ <notflixbot.matrix.MatrixClient object at 0x7f64b19af790> File "/home/ben/projects/notflixbot/notflixbot/matrix.py", line 80, in close await self._socket.close() │ │ └ <function _AsyncSocket.close at 0x7f64b4bc40d0> │ └ <zmq.asyncio.Socket(zmq.PAIR) at 0x7f64b19b1400 closed> └ <notflixbot.matrix.MatrixClient object at 0x7f64b19af790> TypeError: object NoneType can't be used in 'await' expression ``` Also opened as https://git.sudo.is/ops/meta/issues/1 and was halfway fixed with #2.
ben closed this issue 2024-12-31 14:13:31 +00:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ben/notflixbot#3
No description provided.