Trio – a friendly Python library for async concurrency and I/O
This report summarizes scanner evidence for python-trio/trio, a Python project with 7,346 GitHub stars. SynthScan examined 52,273 lines of code across 185 source files, recording 1749 pattern matches distributed across 18 syntactic categories. The legacy adjusted pattern signal is 31.1 (High pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 679 finding(s).
Are imports declared and package/API names verified? 987 finding(s).
Are wrappers, guards, and repeated structures necessary? 542 finding(s).
Which changes need focused human review? 1749 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 1749 distinct pattern matches across 18 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/source/conf.py | 19 | CODE | |
| LOW | docs/source/conf.py | 35 | CODE | |
| LOW | docs/source/local_customization.py | 1 | CODE | |
| LOW | docs/source/local_customization.py | 5 | CODE | |
| LOW | docs/source/local_customization.py | 8 | CODE | |
| LOW | docs/source/local_customization.py | 8 | CODE | |
| LOW | docs/source/local_customization.py | 8 | CODE | |
| LOW | docs/source/local_customization.py | 8 | CODE | |
| LOW | docs/source/typevars.py | 6 | CODE | |
| LOW | src/trio/_signals.py | 1 | CODE | |
| LOW | src/trio/_path.py | 1 | CODE | |
| LOW | src/trio/_highlevel_open_unix_stream.py | 1 | CODE | |
| LOW | src/trio/_ssl.py | 1 | CODE | |
| LOW | src/trio/_highlevel_open_tcp_listeners.py | 1 | CODE | |
| LOW | src/trio/_socket.py | 1 | CODE | |
| LOW | src/trio/_abc.py | 1 | CODE | |
| LOW | src/trio/_subprocess.py | 1 | CODE | |
| LOW | src/trio/_highlevel_serve_listeners.py | 1 | CODE | |
| LOW | src/trio/_channel.py | 1 | CODE | |
| LOW | src/trio/_timeouts.py | 1 | CODE | |
| LOW | src/trio/to_thread.py | 1 | CODE | |
| LOW | src/trio/to_thread.py | 1 | CODE | |
| LOW | src/trio/_deprecate.py | 1 | CODE | |
| LOW | src/trio/_windows_pipes.py | 1 | CODE | |
| LOW | src/trio/__init__.py | 3 | CODE | |
| LOW | src/trio/__init__.py | 22 | CODE | |
| LOW | src/trio/__init__.py | 26 | CODE | |
| LOW | src/trio/__init__.py | 26 | CODE | |
| LOW | src/trio/__init__.py | 26 | CODE | |
| LOW | src/trio/__init__.py | 26 | CODE | |
| LOW | src/trio/__init__.py | 26 | CODE | |
| LOW | src/trio/__init__.py | 33 | CODE | |
| LOW | src/trio/__init__.py | 33 | CODE | |
| LOW | src/trio/__init__.py | 33 | CODE | |
| LOW | src/trio/__init__.py | 33 | CODE | |
| LOW | src/trio/__init__.py | 33 | CODE | |
| LOW | src/trio/__init__.py | 33 | CODE | |
| LOW | src/trio/__init__.py | 33 | CODE | |
| LOW | src/trio/__init__.py | 33 | CODE | |
| LOW | src/trio/__init__.py | 33 | CODE | |
| LOW | src/trio/__init__.py | 33 | CODE | |
| LOW | src/trio/__init__.py | 33 | CODE | |
| LOW | src/trio/__init__.py | 33 | CODE | |
| LOW | src/trio/__init__.py | 33 | CODE | |
| LOW | src/trio/__init__.py | 33 | CODE | |
| LOW | src/trio/__init__.py | 33 | CODE | |
| LOW | src/trio/__init__.py | 50 | CODE | |
| LOW | src/trio/__init__.py | 51 | CODE | |
| LOW | src/trio/__init__.py | 51 | CODE | |
| LOW | src/trio/__init__.py | 51 | CODE | |
| LOW | src/trio/__init__.py | 56 | CODE | |
| LOW | src/trio/__init__.py | 56 | CODE | |
| LOW | src/trio/__init__.py | 57 | CODE | |
| LOW | src/trio/__init__.py | 57 | CODE | |
| LOW | src/trio/__init__.py | 61 | CODE | |
| LOW | src/trio/__init__.py | 61 | CODE | |
| LOW | src/trio/__init__.py | 65 | CODE | |
| LOW | src/trio/__init__.py | 66 | CODE | |
| LOW | src/trio/__init__.py | 67 | CODE | |
| LOW | src/trio/__init__.py | 68 | CODE | |
| 924 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/source/conf.py | 147 | def autodoc_process_signature( | CODE |
| LOW | docs/source/conf.py | 181 | def autodoc_process_docstring( | CODE |
| LOW | src/trio/_path.py | 92 | def _wrap_method_path_iterable( | CODE |
| LOW | src/trio/_ssl.py | 869 | async def wait_send_all_might_not_block(self) -> None: | STRING |
| LOW | src/trio/_socket.py | 101 | def set_custom_hostname_resolver( | CODE |
| LOW | src/trio/_socket.py | 135 | def set_custom_socket_factory( | CODE |
| LOW | src/trio/_socket.py | 386 | def _sniff_sockopts_for_fileno( | CODE |
| LOW | src/trio/_socket.py | 433 | def _make_simple_sock_method_wrapper( | CODE |
| LOW | src/trio/_abc.py | 357 | async def wait_send_all_might_not_block(self) -> None: | CODE |
| LOW | src/trio/_windows_pipes.py | 73 | async def wait_send_all_might_not_block(self) -> None: | CODE |
| LOW | src/trio/_highlevel_generic.py | 98 | async def wait_send_all_might_not_block(self) -> None: | CODE |
| LOW | src/trio/_highlevel_ssl_helpers.py | 80 | async def open_ssl_over_tcp_listeners( | CODE |
| LOW | src/trio/_threads.py | 87 | async def wait_all_threads_completed() -> None: | CODE |
| LOW | src/trio/_threads.py | 126 | def current_default_thread_limiter() -> CapacityLimiter: | CODE |
| LOW | src/trio/_threads.py | 366 | def report_back_in_trio_thread_fn(result: outcome.Outcome[RetT]) -> None: | CODE |
| LOW | src/trio/_threads.py | 367 | def do_release_then_return_result() -> RetT: | CODE |
| LOW | src/trio/_threads.py | 461 | def from_thread_check_cancelled() -> None: | CODE |
| LOW | src/trio/_util.py | 63 | def _return_value_looks_like_wrong_library(value: object) -> bool: | CODE |
| LOW | src/trio/_util.py | 344 | def raise_single_exception_from_group( | CODE |
| LOW | src/trio/_dtls.py | 121 | def part_of_handshake_untrusted(packet: bytes) -> bool: | CODE |
| LOW | src/trio/_dtls.py | 128 | def is_client_hello_untrusted(packet: bytes) -> bool: | CODE |
| LOW | src/trio/_dtls.py | 210 | def decode_handshake_fragment_untrusted(payload: bytes) -> HandshakeFragment: | CODE |
| LOW | src/trio/_dtls.py | 240 | def encode_handshake_fragment(hsf: HandshakeFragment) -> bytes: | CODE |
| LOW | src/trio/_dtls.py | 251 | def decode_client_hello_untrusted(packet: bytes) -> tuple[int, bytes, bytes]: | CODE |
| LOW | src/trio/_dtls.py | 676 | async def handle_client_hello_untrusted( | CODE |
| LOW | src/trio/_sync.py | 293 | def acquire_on_behalf_of_nowait(self, borrower: Task | object) -> None: | CODE |
| LOW | src/trio/_unix_pipes.py | 155 | async def wait_send_all_might_not_block(self) -> None: | CODE |
| LOW | src/trio/_highlevel_socket.py | 44 | def _translate_socket_errors_to_stream_errors() -> Generator[None, None, None]: | CODE |
| LOW | src/trio/_highlevel_socket.py | 126 | async def wait_send_all_might_not_block(self) -> None: | CODE |
| LOW | src/trio/_tests/test_scheduler_determinism.py | 27 | def test_the_trio_scheduler_is_not_deterministic() -> None: | CODE |
| LOW | src/trio/_tests/test_scheduler_determinism.py | 33 | def test_the_trio_scheduler_is_deterministic_if_seeded( | CODE |
| LOW | src/trio/_tests/test_highlevel_open_unix_stream.py | 40 | async def test_open_with_bad_filename_type(filename: float) -> None: | CODE |
| LOW | src/trio/_tests/test_testing_raisesgroup.py | 75 | def test_incorrect_number_exceptions() -> None: | CODE |
| LOW | src/trio/_tests/test_testing_raisesgroup.py | 260 | def test_catch_unwrapped_exceptions() -> None: | CODE |
| LOW | src/trio/_tests/test_testing_raisesgroup.py | 400 | def test_unwrapped_match_check() -> None: | CODE |
| LOW | src/trio/_tests/test_testing_raisesgroup.py | 683 | def test_suggestion_on_nested_and_brief_error() -> None: | CODE |
| LOW | src/trio/_tests/test_testing_raisesgroup.py | 748 | def test_assert_message_nested() -> None: | CODE |
| LOW | src/trio/_tests/test_testing_raisesgroup.py | 835 | def test_check_no_patched_repr() -> None: | CODE |
| LOW | src/trio/_tests/test_testing_raisesgroup.py | 895 | def test_brief_error_on_one_fail() -> None: | CODE |
| LOW | src/trio/_tests/test_testing_raisesgroup.py | 1087 | def test_raisesgroup_tostring() -> None: | CODE |
| LOW | src/trio/_tests/test_testing_raisesgroup.py | 1117 | def test_raisesgroup_matcher_deprecation() -> None: | CODE |
| LOW | src/trio/_tests/test_exports.py | 39 | def _ensure_mypy_cache_updated() -> None: | CODE |
| LOW | src/trio/_tests/test_exports.py | 68 | def test_core_is_properly_reexported() -> None: | CODE |
| LOW | src/trio/_tests/test_exports.py | 141 | def test_static_tool_sees_all_symbols(tool: str, modname: str, tmp_path: Path) -> None: | CODE |
| LOW | src/trio/_tests/test_exports.py | 269 | def test_static_tool_sees_class_members( | CODE |
| LOW | src/trio/_tests/test_exports.py | 612 | def test_pyright_recognizes_init_attributes() -> None: | CODE |
| LOW | src/trio/_tests/test_tracing.py | 40 | async def test_task_iter_await_frames() -> None: | CODE |
| LOW | src/trio/_tests/test_tracing.py | 57 | async def test_task_iter_await_frames_async_gen() -> None: | CODE |
| LOW | src/trio/_tests/test_tracing.py | 74 | async def test_closed_task_iter_await_frames() -> None: | CODE |
| LOW | src/trio/_tests/test_signals.py | 17 | async def test_open_signal_receiver() -> None: | CODE |
| LOW | src/trio/_tests/test_signals.py | 41 | async def test_open_signal_receiver_restore_handler_after_one_bad_signal() -> None: | CODE |
| LOW⚡ | src/trio/_tests/test_signals.py | 53 | def test_open_signal_receiver_empty_fail() -> None: | CODE |
| LOW⚡ | src/trio/_tests/test_signals.py | 59 | async def test_open_signal_receiver_restore_handler_after_duplicate_signal() -> None: | CODE |
| LOW⚡ | src/trio/_tests/test_signals.py | 67 | async def test_catch_signals_wrong_thread() -> None: | CODE |
| LOW⚡ | src/trio/_tests/test_signals.py | 76 | async def test_open_signal_receiver_conflict() -> None: | CODE |
| LOW⚡ | src/trio/_tests/test_signals.py | 86 | async def wait_run_sync_soon_idempotent_queue_barrier() -> None: | CODE |
| LOW⚡ | src/trio/_tests/test_signals.py | 93 | async def test_open_signal_receiver_no_starvation() -> None: | CODE |
| LOW | src/trio/_tests/test_signals.py | 124 | async def test_catch_signals_race_condition_on_exit() -> None: | CODE |
| LOW | src/trio/_tests/test_highlevel_ssl_helpers.py | 78 | async def test_open_ssl_over_tcp_stream_and_everything_else( | CODE |
| LOW | src/trio/_tests/test_highlevel_ssl_helpers.py | 152 | async def test_open_ssl_over_tcp_listeners() -> None: | CODE |
| 399 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | src/trio/_socket.py | 506 | except (OSError, TypeError): | CODE |
| HIGH | src/trio/_socket.py | 1020 | except BlockingIOError: | CODE |
| HIGH | src/trio/_subprocess.py | 180 | except OSError: # pragma: no cover | CODE |
| HIGH | src/trio/_subprocess.py | 726 | except trio.BrokenResourceError: | CODE |
| HIGH | src/trio/_channel.py | 240 | except trio.WouldBlock: | CODE |
| HIGH | src/trio/_channel.py | 394 | except trio.WouldBlock: | CODE |
| HIGH | src/trio/_threads.py | 518 | except RuntimeError: | CODE |
| HIGH | src/trio/_dtls.py | 707 | except (OSError, trio.ClosedResourceError): | CODE |
| HIGH | src/trio/_dtls.py | 1010 | except (SSL.WantReadError, SSL.Error): | CODE |
| HIGH | src/trio/_highlevel_socket.py | 383 | except OSError: | CODE |
| HIGH | src/trio/_tests/test_highlevel_ssl_helpers.py | 39 | except trio.BrokenResourceError: | CODE |
| HIGH | src/trio/_tests/test_unix_pipes.py | 54 | except BlockingIOError: | CODE |
| HIGH | src/trio/_tests/test_socket.py | 1196 | except FileNotFoundError: | CODE |
| HIGH | src/trio/_tests/test_socket.py | 1211 | except BlockingIOError: | CODE |
| HIGH | src/trio/_tests/test_socket.py | 719 | except (AttributeError, OSError): | CODE |
| HIGH | src/trio/_tests/test_dtls.py | 523 | except BadPacket: | CODE |
| HIGH | src/trio/_tests/test_dtls.py | 203 | except RuntimeError: # pragma: no cover | CODE |
| HIGH | src/trio/_tests/test_channel.py | 354 | except trio.WouldBlock: | CODE |
| HIGH | src/trio/_core/_mock_clock.py | 119 | except AttributeError: | CODE |
| HIGH | src/trio/_core/_asyncgens.py | 146 | except StopIteration: | CODE |
| HIGH | src/trio/_core/_wakeup_socketpair.py | 49 | except BlockingIOError: | CODE |
| HIGH | src/trio/_core/_io_windows.py | 603 | except KeyError: | CODE |
| HIGH | src/trio/_core/_run.py | 143 | except ImportError: | CODE |
| HIGH | src/trio/_core/_ki.py | 183 | except KeyError: | CODE |
| HIGH | src/trio/_core/_ki.py | 140 | except KeyError: | CODE |
| HIGH | src/trio/_core/_tests/test_run.py | 1590 | except _core.RunFinishedError: | CODE |
| HIGH | src/trio/_core/_tests/test_io.py | 32 | except BlockingIOError: | CODE |
| HIGH | src/trio/_core/_tests/test_io.py | 40 | except BlockingIOError: | CODE |
| HIGH | src/trio/_subprocess_platform/waitid.py | 87 | except OSError: | CODE |
| HIGH | src/trio/testing/_check_streams.py | 403 | except _core.BrokenResourceError: # pragma: no cover | CODE |
| HIGH | src/trio/testing/_check_streams.py | 386 | except _core.BrokenResourceError: # pragma: no cover | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test-requirements.txt | 1 | # This file was autogenerated by uv via the following command: | COMMENT |
| LOW | test-requirements.txt | 21 | certifi==2026.7.22 | COMMENT |
| LOW | test-requirements.txt | 41 | # via -r test-requirements.in | COMMENT |
| LOW | test-requirements.txt | 61 | # via | COMMENT |
| LOW | test-requirements.txt | 81 | librt==0.16.0 ; implementation_name == 'cpython' and platform_python_implementation != 'PyPy' | COMMENT |
| LOW | test-requirements.txt | 101 | packaging==26.3 | COMMENT |
| LOW | test-requirements.txt | 121 | # via -r test-requirements.in | COMMENT |
| LOW | test-requirements.txt | 161 | # via sphinx | COMMENT |
| LOW | test-requirements.txt | 181 | trustme==1.2.1 | COMMENT |
| LOW | test-requirements.txt | 201 | # exceptiongroup | COMMENT |
| LOW | docs-requirements.txt | 1 | # This file was autogenerated by uv via the following command: | COMMENT |
| LOW | docs-requirements.txt | 21 | click==8.5.0 | COMMENT |
| LOW | docs-requirements.txt | 41 | jinja2==3.1.6 | COMMENT |
| LOW | docs-requirements.txt | 61 | # via sphinx | COMMENT |
| LOW | docs-requirements.txt | 81 | # sphinx-rtd-theme | COMMENT |
| LOW | docs-requirements.txt | 101 | # via sphinx | COMMENT |
| LOW | tox.ini | 1 | [tox] | COMMENT |
| LOW | ci.sh | 61 | flags="--skip-ssl-imports" | COMMENT |
| LOW | ci.sh | 81 | if [ "$LSP_EXTRACT_FILE" != "" ]; then | COMMENT |
| LOW | docs/source/conf.py | 1 | #!/usr/bin/env python3 | COMMENT |
| LOW | docs/source/conf.py | 101 | # methods to help it resolve links. | COMMENT |
| LOW | docs/source/conf.py | 361 | COMMENT | |
| LOW | docs/source/conf.py | 401 | # -- Options for HTMLHelp output ------------------------------------------ | COMMENT |
| LOW | src/trio/_signals.py | 21 | # the only available API. | COMMENT |
| LOW | src/trio/_signals.py | 41 | # manipulate signal state (e.g. setting SIG_IGN) which as far as Python is | COMMENT |
| LOW | src/trio/_ssl.py | 21 | Ts = TypeVarTuple("Ts") | COMMENT |
| LOW | src/trio/_ssl.py | 41 | # | COMMENT |
| LOW | src/trio/_ssl.py | 61 | # might require some arbitrary sequence of sends and receives from the remote | COMMENT |
| LOW | src/trio/_ssl.py | 81 | # handshake, and then to turn around and do a second handshake (= | COMMENT |
| LOW | src/trio/_ssl.py | 101 | # it does a handshake, which remember is a process with multiple round | COMMENT |
| LOW | src/trio/_ssl.py | 121 | # *exactly that method call* later – in particular, if a 'write' failed, we | COMMENT |
| LOW | src/trio/_ssl.py | 141 | # task calling receive_some, those two tasks might end up both wanting to call | COMMENT |
| LOW | src/trio/_ssl.py | 161 | COMMENT | |
| LOW | src/trio/_ssl.py | 181 | # Ideally, when the user calls SSLStream.receive_some() with no argument, then | COMMENT |
| LOW | src/trio/_ssl.py | 481 | # | COMMENT |
| LOW | src/trio/_ssl.py | 541 | # | COMMENT |
| LOW | src/trio/_ssl.py | 561 | # might have to do, and any given operation might require | COMMENT |
| LOW | src/trio/_ssl.py | 581 | # we have to do both is very unusual (only during a | COMMENT |
| LOW | src/trio/_ssl.py | 601 | try: | COMMENT |
| LOW | src/trio/_ssl.py | 801 | await self.transport_stream.aclose() | COMMENT |
| LOW | src/trio/_ssl.py | 821 | # time. (Like e.g. anyone using Python ssl in synchronous mode.) | COMMENT |
| LOW | src/trio/_ssl.py | 841 | # to _retry will do is send the close_notify alert, so that's | COMMENT |
| LOW | src/trio/_ssl.py | 881 | # task calling self.receive_some -> transport_stream.send_all, in | COMMENT |
| LOW | src/trio/_highlevel_open_tcp_listeners.py | 21 | # Having the backlog too low can cause practical problems (a perfectly healthy | COMMENT |
| LOW | src/trio/_socket.py | 41 | # and the return type of several methods in SocketType will depend on those. Typeshed | COMMENT |
| LOW | src/trio/_socket.py | 221 | family, | COMMENT |
| LOW | src/trio/_socket.py | 981 | # '"kwargs" member of ParamSpec is valid only when used with **kwargs parameter' | COMMENT |
| LOW | src/trio/_socket.py | 1001 | # for read *before* we call accept, then we'll be waiting | COMMENT |
| LOW | src/trio/_socket.py | 1041 | async def connect(self, address: AddressFormat) -> None: | COMMENT |
| LOW | src/trio/_socket.py | 1061 | # | COMMENT |
| LOW | src/trio/_socket.py | 1081 | # confirmed this is true there: | COMMENT |
| LOW | src/trio/_socket.py | 1101 | # We can't really cancel a connect, and the socket is in an | COMMENT |
| LOW | src/trio/_socket.py | 1321 | # Intentionally omitted: | COMMENT |
| LOW | src/trio/_subprocess.py | 61 | # this workaround is needed on: | COMMENT |
| LOW | src/trio/_subprocess.py | 781 | else: | COMMENT |
| LOW | src/trio/__init__.py | 1 | """Trio - A friendly Python library for async concurrency and I/O""" | COMMENT |
| LOW | src/trio/_dtls.py | 101 | COMMENT | |
| LOW | src/trio/_dtls.py | 281 | # | COMMENT |
| LOW | src/trio/_dtls.py | 481 | if packet: | COMMENT |
| LOW | src/trio/_dtls.py | 501 | # second ClientHello, this time with the magic cookie included, and after we | COMMENT |
| 80 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | src/trio/_core/_generated_io_windows.py | 0 | block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer file | STRING |
| HIGH | src/trio/_core/_io_windows.py | 0 | block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer file | STRING |
| HIGH | src/trio/_core/_io_kqueue.py | 0 | block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer file | STRING |
| HIGH | src/trio/_core/_generated_io_epoll.py | 0 | block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer file | STRING |
| HIGH | src/trio/_core/_io_epoll.py | 0 | block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer file | STRING |
| HIGH | src/trio/_core/_generated_io_kqueue.py | 0 | block until the kernel reports that the given object is readable. on unix systems, ``fd`` must either be an integer file | STRING |
| HIGH | src/trio/_core/_generated_io_windows.py | 0 | block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :rai | STRING |
| HIGH | src/trio/_core/_io_windows.py | 0 | block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :rai | STRING |
| HIGH | src/trio/_core/_io_kqueue.py | 0 | block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :rai | STRING |
| HIGH | src/trio/_core/_generated_io_epoll.py | 0 | block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :rai | STRING |
| HIGH | src/trio/_core/_io_epoll.py | 0 | block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :rai | STRING |
| HIGH | src/trio/_core/_generated_io_kqueue.py | 0 | block until the kernel reports that the given object is writable. see `wait_readable` for the definition of ``fd``. :rai | STRING |
| HIGH | src/trio/_core/_generated_io_windows.py | 0 | notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or socke | STRING |
| HIGH | src/trio/_core/_io_kqueue.py | 0 | notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or socke | STRING |
| HIGH | src/trio/_core/_generated_io_epoll.py | 0 | notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or socke | STRING |
| HIGH | src/trio/_core/_io_epoll.py | 0 | notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or socke | STRING |
| HIGH | src/trio/_core/_generated_io_kqueue.py | 0 | notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or socke | STRING |
| HIGH | src/trio/_core/_io_windows.py | 0 | notify waiters of the given object that it will be closed. call this before closing a file descriptor (on unix) or socke | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | src/trio/_highlevel_open_unix_stream.py | 41 | Opens a connection to the specified `Unix domain socket <https://en.wikipedia.org/wiki/Unix_domain_socket>`__. | STRING |
| HIGH | src/trio/_highlevel_open_tcp_listeners.py | 63 | Create :class:`SocketListener` objects to listen for TCP connections. Args: port (int): The port to listen o | STRING |
| HIGH | src/trio/_abc.py | 438 | Wait until there is data available on this stream, and then return some of it. A return value of ``b""` | STRING |
| HIGH | src/trio/_subprocess.py | 314 | Execute a child program in a new process. After construction, you can interact with the child process by writing da | STRING |
| HIGH | src/trio/_subprocess.py | 477 | Run ``command`` in a subprocess and wait for it to complete. This function can be called in two different ways. | STRING |
| HIGH | src/trio/_subprocess.py | 830 | Execute a child program in a new process. After construction, you can interact with the child process by wr | STRING |
| HIGH | src/trio/_subprocess.py | 893 | Run ``command`` in a subprocess and wait for it to complete. This function can be called in two different w | STRING |
| HIGH | src/trio/_threads.py | 264 | Convert a blocking operation into an async operation using a thread. These two lines are equivalent:: sync | STRING |
| HIGH | src/trio/_highlevel_open_tcp_stream.py | 192 | Connect to the given host and port over TCP. If the given ``host`` has multiple IP addresses associated with it, th | STRING |
| HIGH | src/trio/_core/_run.py | 2432 | Run a Trio-flavored async function, and return the result. Calling:: run(async_fn, *args) is the equiv | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/source/typevars.py | 21 | CODE | |
| LOW | src/trio/_ssl.py | 461 | CODE | |
| LOW | src/trio/_highlevel_open_tcp_listeners.py | 57 | CODE | |
| LOW | src/trio/_channel.py | 521 | CODE | |
| LOW | src/trio/_channel.py | 594 | CODE | |
| LOW | src/trio/_threads.py | 257 | CODE | |
| LOW | src/trio/_dtls.py | 356 | CODE | |
| LOW | src/trio/_dtls.py | 744 | CODE | |
| LOW | src/trio/_dtls.py | 411 | CODE | |
| LOW | src/trio/_dtls.py | 932 | CODE | |
| LOW | src/trio/_unix_pipes.py | 130 | CODE | |
| LOW | src/trio/_unix_pipes.py | 161 | CODE | |
| LOW | src/trio/_highlevel_socket.py | 109 | CODE | |
| LOW | src/trio/_tests/test_highlevel_open_unix_stream.py | 55 | CODE | |
| LOW | src/trio/_tests/test_exports.py | 141 | CODE | |
| LOW | src/trio/_tests/test_exports.py | 269 | CODE | |
| LOW | src/trio/_tests/test_signals.py | 93 | CODE | |
| LOW | src/trio/_tests/test_socket.py | 620 | CODE | |
| LOW | src/trio/_tests/test_socket.py | 764 | CODE | |
| LOW | src/trio/_tests/test_socket.py | 840 | CODE | |
| LOW | src/trio/_tests/test_socket.py | 926 | CODE | |
| LOW | src/trio/_tests/test_dtls.py | 141 | CODE | |
| LOW | src/trio/_tests/test_dtls.py | 507 | CODE | |
| LOW | src/trio/_tests/test_dtls.py | 155 | CODE | |
| LOW | src/trio/_tests/test_ssl.py | 105 | CODE | |
| LOW | src/trio/_tests/test_ssl.py | 279 | CODE | |
| LOW | src/trio/_tests/check_type_completeness.py | 116 | CODE | |
| LOW | src/trio/_core/_io_kqueue.py | 246 | CODE | |
| LOW | src/trio/_core/_io_windows.py | 558 | CODE | |
| LOW | src/trio/_core/_run.py | 2713 | CODE | |
| LOW | src/trio/_core/_run.py | 477 | CODE | |
| LOW | src/trio/_core/_run.py | 632 | CODE | |
| LOW | src/trio/_core/_run.py | 761 | CODE | |
| LOW | src/trio/_core/_run.py | 1558 | CODE | |
| LOW | src/trio/_core/_tests/test_run.py | 459 | CODE | |
| LOW | src/trio/_core/_tests/test_run.py | 512 | CODE | |
| LOW | src/trio/_core/_tests/test_io.py | 388 | CODE | |
| LOW | src/trio/_core/_tests/test_guest_mode.py | 48 | CODE | |
| LOW | src/trio/_core/_tests/test_windows.py | 121 | CODE | |
| LOW | src/trio/_tools/mypy_annotate.py | 85 | CODE | |
| LOW | src/trio/_tools/sync_requirements.py | 41 | CODE | |
| LOW | src/trio/testing/_raises_group.py | 513 | CODE | |
| LOW | src/trio/testing/_raises_group.py | 794 | CODE | |
| LOW | src/trio/testing/_raises_group.py | 945 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/trio/_socket.py | 610 | def set_inheritable(self, inheritable: bool) -> None: | STRING |
| LOW | src/trio/_socket.py | 871 | def set_inheritable(self, inheritable: bool) -> None: | CODE |
| LOW | src/trio/to_thread.py | 4 | __all__ = ["current_default_thread_limiter", "run_sync"] | CODE |
| LOW | src/trio/from_thread.py | 13 | __all__ = ["check_cancelled", "run", "run_sync"] | CODE |
| LOW | src/trio/_dtls.py | 408 | def set_first_record_number(self, n: int) -> None: | CODE |
| LOW | src/trio/_dtls.py | 859 | def _set_replaced(self) -> None: | CODE |
| LOW | src/trio/_dtls.py | 1105 | def set_ciphertext_mtu(self, new_mtu: int) -> None: | CODE |
| LOW | src/trio/_dtls.py | 1372 | def set_ssl_context_options(ctx: SSL.Context) -> None: | CODE |
| LOW | src/trio/_core/_generated_io_windows.py | 24 | __all__ = [ | CODE |
| LOW | src/trio/_core/_generated_instrumentation.py | 14 | __all__ = ["add_instrument", "remove_instrument"] | CODE |
| LOW | src/trio/_core/_generated_io_epoll.py | 18 | __all__ = ["notify_closing", "wait_readable", "wait_writable"] | CODE |
| LOW | src/trio/_core/_io_epoll.py | 264 | def _update_registrations(self, fd: int) -> None: | CODE |
| LOW | src/trio/_core/_generated_io_kqueue.py | 24 | __all__ = [ | CODE |
| LOW | src/trio/_core/_generated_run.py | 23 | __all__ = [ | CODE |
| LOW⚡ | src/trio/_core/_tests/test_guest_mode.py | 214 | def set_deadline(cscope: trio.CancelScope, new_deadline: float) -> None: | CODE |
| LOW⚡ | src/trio/_core/_tests/test_guest_mode.py | 357 | def set_deadline(cscope: trio.CancelScope, new_deadline: float) -> None: | CODE |
| LOW | src/trio/testing/_raises_group.py | 976 | def set_result(self, expected: int, actual: int, result: str | None) -> None: | CODE |
| LOW | src/trio/testing/_fake_net.py | 575 | def set_inheritable(self, inheritable: bool) -> None: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | src/trio/_highlevel_socket.py | 214 | # ===================== | COMMENT |
| MEDIUM | src/trio/_highlevel_socket.py | 217 | # ----------------- | COMMENT |
| MEDIUM | src/trio/_highlevel_socket.py | 258 | # ----------- | COMMENT |
| MEDIUM | src/trio/_highlevel_socket.py | 305 | # ------------------ | COMMENT |
| MEDIUM | src/trio/_core/_io_epoll.py | 42 | # ---------------------- | COMMENT |
| MEDIUM | src/trio/_core/_io_epoll.py | 123 | # ----------------------------- | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | src/trio/_tests/test_socket.py | 644 | got = await sock._resolve_address_nocp((null, 80), local=True) | CODE |
| HIGH | src/trio/_tests/test_socket.py | 647 | got = await sock._resolve_address_nocp((null, 80), local=False) | CODE |
| HIGH | src/trio/_core/_windows_cffi.py | 135 | # this is wrong (it's not always null) | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | ci.sh | 15 | # Curl's built-in retry system is not very robust; it gives up on lots of | COMMENT |
| MEDIUM | src/trio/_ssl.py | 167 | # Definitely keep an eye on Cory's TLS API ideas on security-sig etc. | COMMENT |
| LOW | src/trio/_highlevel_open_tcp_listeners.py | 43 | # so this is unnecessary -- we can just pass in "infinity" and get the maximum | COMMENT |
| LOW | src/trio/_util.py | 120 | # function. So we have to just call it and then check whether the | COMMENT |
| MEDIUM | src/trio/_dtls.py | 64 | # comprehensive collection look here: | COMMENT |
| LOW | src/trio/_dtls.py | 339 | # just pass it through unchanged. (Fortunately, the payload is only a single hash value, | COMMENT |
| LOW | src/trio/_core/_io_windows.py | 153 | # IOCTL_AFD_POLL. This means we can't just use the wait_overlapped machinery. | COMMENT |
| LOW | src/trio/_core/_io_windows.py | 358 | # If this is not a Komodia-intercepted socket, we can just use | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | docs/source/conf.py | 6 | # This file is execfile()d with the current directory set to its | COMMENT |
| MEDIUM | src/trio/_version.py | 1 | # This file is imported from __init__.py and parsed by setuptools | COMMENT |
| MEDIUM | src/trio/_core/_tests/test_run.py | 2103 | # This function isn't testing task_status, it's using task_status as a | COMMENT |
| MEDIUM | src/trio/_core/_tests/test_run.py | 2346 | # This function is async so that we have access to a task object we can | COMMENT |
| MEDIUM | src/trio/_tools/gen_exports.py | 239 | # Create the function definition including the body | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/source/tutorial/echo-server.py | 28 | except Exception as exc: | CODE |
| LOW | src/trio/_tests/test_ssl.py | 144 | except Exception as exc: | CODE |
| LOW | src/trio/_tests/test_threads.py | 244 | except Exception: | CODE |
| LOW | src/trio/_core/_thread_cache.py | 68 | except Exception: # pragma: no cover | CODE |
| LOW | src/trio/_core/_exceptions.py | 62 | except Exception: | STRING |
| MEDIUM | src/trio/_core/_tests/test_run.py | 940 | def unstarted_task() -> None: | CODE |
| LOW | src/trio/_core/_tests/test_exceptiongroup_gc.py | 43 | except Exception as exc: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/trio/_ssl.py | 458 | # comments, though, just make sure to think carefully if you ever have to | STRING |
| LOW | src/trio/_file_io.py | 36 | # This list is also in the docs, make sure to keep them in sync | COMMENT |
| LOW | src/trio/_file_io.py | 58 | # This list is also in the docs, make sure to keep them in sync | COMMENT |
| LOW | src/trio/_tests/test_unix_pipes.py | 45 | # make sure to write >PIPE_BUF bytes each time, which disables | COMMENT |
| LOW | src/trio/_core/_thread_cache.py | 82 | # Just need to make sure to call it correctly | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | src/trio/_tests/test_channel.py | 582 | CODE | |
| MEDIUM | src/trio/_tests/test_channel.py | 733 | CODE | |
| MEDIUM | src/trio/_tests/test_channel.py | 467 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …cs/source/reference-core/thread-contextvars-example.py | 24 | async def handle_request(current_user_id): | CODE |
| LOW | docs/source/reference-core/contextvar-example.py | 18 | async def handle_request(tag): | CODE |
| LOW | …_tests/test_deprecate_strict_exception_groups_false.py | 35 | def helper(fun: Callable[[], Awaitable[None]], num: int) -> None: | CODE |
| LOW | src/trio/_tests/test_subprocess.py | 655 | async def do_stuff() -> None: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | pyproject.toml | 246 | # Usage: | STRING |
| LOW | src/trio/_socket.py | 53 | # Usage: | COMMENT |
| LOW | src/trio/_core/_tests/tutil.py | 92 | # Example usage: | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/trio/_dtls.py | 730 | # Check if we have an existing association | COMMENT |