pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/encode/httpx/pull/3767

github.githubassets.com/assets/actions-26401580c700f528.css" /> Include header name in encoding error message by worksbyfriday · Pull Request #3767 · encode/httpx · GitHub
Skip to content

Include header name in encoding error message#3767

Open
worksbyfriday wants to merge 1 commit intoencode:masterfrom
worksbyfriday:fix-header-encoding-error-message
Open

Include header name in encoding error message#3767
worksbyfriday wants to merge 1 commit intoencode:masterfrom
worksbyfriday:fix-header-encoding-error-message

Conversation

@worksbyfriday
Copy link
Copy Markdown

Summary

  • When a header value contains non-ASCII characters that can't be encoded, the UnicodeEncodeError now includes the header name
  • Before: 'ascii' codec can't encode characters in position 0-27: ordinal not in range(128)
  • After: 'ascii' codec can't encode characters in position 0-27: ordinal not in range(128) (header: 'auth')

Fixes #3400

Test plan

  • Added test_header_encoding_error_includes_name verifying error message contains header name
  • All 28 header model tests pass

When a header value contains non-ASCII characters that can't be encoded,
the error message now includes the header name, making it easier to
identify which header is causing the issue.

Fixes #3400

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mention header name error message for invalid header encodings

1 participant

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

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