Skip to content

Running test_asyncio prints several tracebacks when succeeding #96911

@gvanrossum

Description

@gvanrossum

This is a bit distracting. If someone knows where these come from, let's come up with a patch to silence these.

$ ./python.exe -m test test_asyncio
0:00:00 load avg: 1.44 Run tests sequentially
0:00:00 load avg: 1.44 [1/1] test_asyncio
Exception in callback interrupt_self() at /Users/guido/cpython/Lib/test/test_asyncio/test_runners.py:19
handle: <TimerHandle when=50711.269859326 interrupt_self() at /Users/guido/cpython/Lib/test/test_asyncio/test_runners.py:19>
Traceback (most recent call last):
  File "/Users/guido/cpython/Lib/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/guido/cpython/Lib/test/test_asyncio/test_runners.py", line 20, in interrupt_self
    _thread.interrupt_main()
    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/guido/cpython/Lib/asyncio/runners.py", line 146, in _on_sigint
    self._loop.call_soon_threadsafe(lambda: None)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/guido/cpython/Lib/asyncio/base_events.py", line 809, in call_soon_threadsafe
    self._write_to_self()
    ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/guido/cpython/Lib/asyncio/base_events.py", line 511, in _write_to_self
    raise NotImplementedError
    ^^^^^^^^^^^^^^^^^^^^^^^^^
NotImplementedError
Task exception was never retrieved
future: <Task finished name='Task-1679' coro=<RunnerTests.test_interrupt_cancelled_task.<locals>.subtask() done, defined at /Users/guido/cpython/Lib/test/test_asyncio/test_runners.py:367> exception=NotImplementedError()>
Traceback (most recent call last):
  File "/Users/guido/cpython/Lib/test/test_asyncio/test_runners.py", line 370, in subtask
    interrupt_self()
    ^^^^^^^^^^^^^^^^
  File "/Users/guido/cpython/Lib/test/test_asyncio/test_runners.py", line 20, in interrupt_self
    _thread.interrupt_main()
    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/guido/cpython/Lib/asyncio/runners.py", line 146, in _on_sigint
    self._loop.call_soon_threadsafe(lambda: None)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/guido/cpython/Lib/asyncio/base_events.py", line 809, in call_soon_threadsafe
    self._write_to_self()
    ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/guido/cpython/Lib/asyncio/base_events.py", line 511, in _write_to_self
    raise NotImplementedError
    ^^^^^^^^^^^^^^^^^^^^^^^^^
NotImplementedError
Exception in callback interrupt_self() at /Users/guido/cpython/Lib/test/test_asyncio/test_runners.py:19
handle: <TimerHandle when=50711.372428525996 interrupt_self() at /Users/guido/cpython/Lib/test/test_asyncio/test_runners.py:19>
Traceback (most recent call last):
  File "/Users/guido/cpython/Lib/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/guido/cpython/Lib/test/test_asyncio/test_runners.py", line 20, in interrupt_self
    _thread.interrupt_main()
    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/guido/cpython/Lib/asyncio/runners.py", line 146, in _on_sigint
    self._loop.call_soon_threadsafe(lambda: None)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/guido/cpython/Lib/asyncio/base_events.py", line 809, in call_soon_threadsafe
    self._write_to_self()
    ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/guido/cpython/Lib/asyncio/base_events.py", line 511, in _write_to_self
    raise NotImplementedError
    ^^^^^^^^^^^^^^^^^^^^^^^^^
NotImplementedError
test_asyncio passed in 55.0 sec

== Tests result: SUCCESS ==

1 test OK.

Total duration: 55.0 sec
Tests result: SUCCESS
$ 

Tested on macOS. Does not happen in 3.11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixestopic-asynciotype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy