-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move from urlparse to parse_url for prepending schemes #5917
Conversation
Thanks for this! I've pulled in this patch into our internal monorepo and some preliminary testing shows that it's working (I can |
We've rolled this out and it works in prod. |
Thanks for checking, @geofft! I think we just need another maintainer to give this a glance and we can look at moving the review forward. |
# urlparse and parse_url determine that there isn't a netloc present in some | ||
# urls. We've chosen to assume parsing is being over-cautious, and switch | ||
# the netloc and path. This is maintained for backwards compatibility. | ||
netloc = parsed.netloc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhhh, what? This doesn't make any sense to me, is this something that's only needed for urlparse
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is only a quirk for urlparse
. I'd thought I repro'd with parse_url
initially, but I'm unable to now.
I'll reword the whole comment for clarity. I'm not confident the test suite covers all of the initial issue though. I think I'm still in favor of leaving the swap in place as a fallback for anything we're missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sethmlarson I've reworded things to be a bit clearer.
bfab037
to
ef59aa0
Compare
This addresses the base problem raised in #5855 with the
urlparse
changes in Python 3.9 and potential issues in future 3.7/3.8 releases. We've avoided changing other uses ofurlparse
for now due to issues withparse_url
's strict validation requirements when performing parsing.