Skip to content

Improve InvalidURL error message. - #3250

Merged
lovelydinosaur merged 7 commits into
masterfrom
improve-invalid-url-error-message
Jul 26, 2024
Merged

Improve InvalidURL error message.#3250
lovelydinosaur merged 7 commits into
masterfrom
improve-invalid-url-error-message

Conversation

@lovelydinosaur

@lovelydinosaurlovelydinosaur commented Jul 25, 2024

Copy link
Copy Markdown
Contributor

Prompted by #3248.

before...

>>>importhttpx>>>httpx.get("https://www.example.com\n")
Traceback (mostrecentcalllast):
...
File"/Users/tomchristie/GitHub/encode/httpx/httpx/_urlparse.py", line163, inurlparseraiseInvalidURL(error)
httpx.InvalidURL: Invalidnon-printableASCIIcharacterinURL.

after...

>>>importhttpx>>>httpx.get("https://www.example.com\n")
Traceback (mostrecentcalllast):
...
File"/Users/tomchristie/GitHub/encode/httpx/httpx/_urlparse.py", line168, inurlparseraiseInvalidURL(error)
httpx.InvalidURL: Invalidnon-printableASCIIcharacterinURL, '\n'atposition23.

@lovelydinosaurlovelydinosaur added the user-experience Ensuring that users have a good experience using the library label Jul 25, 2024
@lovelydinosaur
lovelydinosaur marked this pull request as ready for review July 25, 2024 10:44
@lovelydinosaur
lovelydinosaur requested a review from a teamJuly 25, 2024 11:10

@adriangbadriangb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nits

Comment threadhttpx/_urlparse.py Outdated
Comment threadhttpx/_urlparse.py Outdated
@lovelydinosaur
lovelydinosaur merged commit 7c0cda1 into masterJul 26, 2024
@lovelydinosaur
lovelydinosaur deleted the improve-invalid-url-error-message branch July 26, 2024 08:36
@mbeijenmbeijen mentioned this pull request Aug 21, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

user-experienceEnsuring that users have a good experience using the library

Development

Successfully merging this pull request may close these issues.

4 participants

@lovelydinosaur@adriangb@musale@Derreck473