Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Encoder.encode()silently changes header names and values supplied as ordinarybytessubclasses. For example, a subclass containingb'custom-key'is encoded as the literal textb"b'custom-key'". A subclass dictionary key containingb':method'also stops being recognized as a pseudo-header.Use
isinstance(value, bytes)in_to_bytes()to preserve the original bytes. This restores the subclass behavior that preceded the performance optimization in #276. Remove the two type ignores made unnecessary by the resulting type narrowing.Seven regression cases cover empty and non-UTF-8 bytes, exact wire encoding and decoding in both Huffman modes, and dictionary pseudo-header ordering. All seven fail on the original source. The independent reviewer also reproduced all seven failures using the original conversion function.
Validation on macOS:
git diff --check,check-manifest, wheel/sdist builds andtwine checkpassed.our github pagetarget atdocs/source/installation.rst:10. Existing Hypothesis initialization warnings remain.AI disclosure: the implementation, regression tests and this description were developed by AI agents. A separate AI agent performed an automated review. No human review is claimed; this PR is a draft pending maintainer review. Hosted CI is not yet verified.