From dd99650aefa4b9fe95f3844afdb46408dab613dc Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 24 Nov 2025 09:16:31 +0100 Subject: [PATCH] Fix typos discovered by codespell --- src/h2/connection.py | 2 +- src/h2/events.py | 2 +- src/h2/frame_buffer.py | 6 +++--- tests/test_flow_control_window.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/h2/connection.py b/src/h2/connection.py index 841e46440..e7c676c1e 100644 --- a/src/h2/connection.py +++ b/src/h2/connection.py @@ -780,7 +780,7 @@ def send_headers(self, on the stream given in ``priority_depends_on`` for priority purposes. See :meth:`prioritize ` for more about how this - field workds. Defaults to ``None``, which means that no priority + field works. Defaults to ``None``, which means that no priority information will be sent. :type priority_depends_on: ``bool`` or ``None`` diff --git a/src/h2/events.py b/src/h2/events.py index 5bb892ebf..e3accea76 100644 --- a/src/h2/events.py +++ b/src/h2/events.py @@ -510,7 +510,7 @@ class SettingsAcknowledged(Event): """ The SettingsAcknowledged event is fired whenever a settings ACK is received from the remote peer. The event carries on it the settings that were - acknowedged, in the same format as + acknowledged, in the same format as :class:`h2.events.RemoteSettingsChanged`. """ diff --git a/src/h2/frame_buffer.py b/src/h2/frame_buffer.py index e7b0a7126..2555cdce5 100644 --- a/src/h2/frame_buffer.py +++ b/src/h2/frame_buffer.py @@ -13,7 +13,7 @@ from .exceptions import FrameDataMissingError, FrameTooLargeError, ProtocolError # To avoid a DOS attack based on sending loads of continuation frames, we limit -# the maximum number we're perpared to receive. In this case, we'll set the +# the maximum number we're prepared to receive. In this case, we'll set the # limit to 64, which means the largest encoded header block we can receive by # default is 262144 bytes long, and the largest possible *at all* is 1073741760 # bytes long. @@ -25,7 +25,7 @@ class FrameBuffer: """ - A buffer data structure for HTTP/2 data that allows iteraton in terms of + A buffer data structure for HTTP/2 data that allows iteration in terms of H2 frames. """ @@ -94,7 +94,7 @@ def _update_header_buffer(self, f: Frame | None) -> Frame | None: # If this is the end of the header block, then we want to build a # mutant HEADERS frame that's massive. Use the original one we got, - # then set END_HEADERS and set its data appopriately. If it's not + # then set END_HEADERS and set its data appropriately. If it's not # the end of the block, lose the current frame: we can't yield it. if "END_HEADERS" in f.flags: f = self._headers_buffer[0] diff --git a/tests/test_flow_control_window.py b/tests/test_flow_control_window.py index 21cc7b8f0..4b26cec8c 100644 --- a/tests/test_flow_control_window.py +++ b/tests/test_flow_control_window.py @@ -730,7 +730,7 @@ def test_must_acknowledge_for_stream(self, frame_factory, stream_id) -> None: frame_factory.refresh_encoder() # Create a connection in a state that might actually accept - # data acknolwedgement. + # data acknowledgement. c = self._setup_connection_and_send_headers(frame_factory) data_frame = frame_factory.build_data_frame( b"some data", flags=["END_STREAM"], @@ -755,7 +755,7 @@ def test_cannot_acknowledge_less_than_zero(self, frame_factory, size) -> None: frame_factory.refresh_encoder() # Create a connection in a state that might actually accept - # data acknolwedgement. + # data acknowledgement. c = self._setup_connection_and_send_headers(frame_factory) data_frame = frame_factory.build_data_frame( b"some data", flags=["END_STREAM"],