Trio – a friendly Python library for async concurrency and I/O
This report presents the forensic synthetic code analysis of python-trio/trio, a Python project with 7,295 GitHub stars. SynthScan v2.0 examined 52,145 lines of code across 185 source files, recording 1684 pattern matches distributed across 17 syntactic categories. The overall adjusted score of 28.0 places this repository in the Moderate AI signal band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 1684 distinct pattern matches across 17 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| 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 | |
| 892 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 | 319 | 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 | 265 | def test_static_tool_sees_class_members( | CODE |
| LOW | src/trio/_tests/test_exports.py | 600 | 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 |
| 397 more matches not shown… | ||||
| 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.6.17 | COMMENT |
| LOW | test-requirements.txt | 41 | coverage==7.14.3 | COMMENT |
| LOW | test-requirements.txt | 61 | filelock==3.29.4 | COMMENT |
| LOW | test-requirements.txt | 81 | # via sphinx | COMMENT |
| LOW | test-requirements.txt | 101 | packaging==26.2 | 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.4.2 | COMMENT |
| LOW | docs-requirements.txt | 41 | immutables==0.21 | COMMENT |
| LOW | docs-requirements.txt | 61 | # via sphinx | COMMENT |
| LOW | docs-requirements.txt | 81 | # -r docs-requirements.in | COMMENT |
| LOW | docs-requirements.txt | 101 | # via sphinx | COMMENT |
| LOW | tox.ini | 1 | [tox] | COMMENT |
| LOW | ci.sh | 61 | # If we're testing with a LSP installed, then it might break network | 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 |
| LOW | src/trio/_dtls.py | 521 | # the HMAC digest, for both the current time and the current time minus 30 seconds, and | COMMENT |
| 81 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 | 508 | CODE | |
| LOW | src/trio/_channel.py | 581 | 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 | 265 | 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 | 114 | 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 | 2109 | # This function isn't testing task_status, it's using task_status as a | COMMENT |
| MEDIUM | src/trio/_core/_tests/test_run.py | 2352 | # 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 | 67 | 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 | 81 | # Just need to make sure to call it correctly | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | src/trio/_tests/test_channel.py | 575 | CODE | |
| MEDIUM | src/trio/_tests/test_channel.py | 726 | CODE | |
| MEDIUM | src/trio/_tests/test_channel.py | 460 | 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 | 245 | # 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 |