🐛 Raises meaningful exception when IPv6 URL is malformed#1512
Merged
bdraco merged 3 commits intoaio-libs:masterfrom Jun 9, 2025
Merged
🐛 Raises meaningful exception when IPv6 URL is malformed#1512bdraco merged 3 commits intoaio-libs:masterfrom
bdraco merged 3 commits intoaio-libs:masterfrom
Conversation
CodSpeed Performance ReportMerging #1512 will not alter performanceComparing Summary
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1512 +/- ##
=======================================
Coverage 99.63% 99.63%
=======================================
Files 29 29
Lines 5795 5806 +11
Branches 265 265
=======================================
+ Hits 5774 5785 +11
Misses 18 18
Partials 3 3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e3af387 to
5001d56
Compare
webknjaz
reviewed
May 22, 2025
Member
|
note: we agreed with Mael that he'll add a change note later on, while traveling |
5001d56 to
f89d97b
Compare
bdraco
reviewed
May 28, 2025
5 tasks
Dreamsorcerer
approved these changes
May 28, 2025
…ersed Problem: If brackets are reversed or content inside brackets is empty, `bracketed_host` will be an empty string. In consequence, reaching the first element of `bracketed_host` returns an `IndexError`. Solution: Use `startswith` because it does not raise anything if the string is empty and then it fallbacks into the following check verifying the presence of `:`. Also, the raised message was made more generic but still keeps its meaning.
f89d97b to
63ba8c5
Compare
bdraco
approved these changes
Jun 9, 2025
Member
|
Thanks @MaelPic |
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.
What do these changes do?
For IPv6 URL, if brackets are set in reversed order (closing bracket before open bracket), the raised exception is now
ValueError("Invalid IPv6 URL"), which is more convenient that the reported one (IndexError: string index out of range).Are there changes in behavior for the user?
If url contains brackets in opposite order:
Previous behavior: exception
IndexErroris raisedNew behavior: exception
ValueErroris raisedRelated issue number
Fixes #1485
Checklist