-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
bpo-27657: Fix urlparse() with numeric paths #661
Conversation
@timgraham, thanks for your PR! By analyzing the history of the files in this pull request, we identified @orsenthil, @ncoghlan, @Yhg1s, @serhiy-storchaka and @facundobatista to be potential reviewers. |
(Fixed the conflicts, which was impressively pleasant!) |
Revert parsing decision from bpo-754016 in favor of the documented consensus in bpo-16932 of how to treat strings without a // to designate the 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.
nice clean ups
This needs a core-dev review and approval. Introducing simple parsing changes can sometimes bring surprises, so we have to cognizant of that, and make sure our intended behavior is preserved. |
Let's go with this. This simplifies the parsing logic in favor of all valid URLS. As noted in https://bugs.python.org/issue27657, all the previous attempts were to handle special cases and it was not helpful. |
@orsenthil: Please replace |
Thanks @timgraham for the PR, and @orsenthil for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.7, 3.8. |
I'm having trouble backporting to |
GH-16837 is a backport of this pull request to the 3.7 branch. |
Sorry, @timgraham and @orsenthil, I could not cleanly backport this to |
* bpo-27657: Fix urlparse() with numeric paths Revert parsing decision from bpo-754016 in favor of the documented consensus in bpo-16932 of how to treat strings without a // to designate the netloc. * bpo-22891: Remove urlsplit() optimization for 'http' prefixed inputs. (cherry picked from commit 5a88d50) Co-authored-by: Tim Graham <timograham@gmail.com>
Thanks @timgraham for the PR, and @orsenthil for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Sorry @timgraham and @orsenthil, I had trouble checking out the |
* bpo-27657: Fix urlparse() with numeric paths Revert parsing decision from bpo-754016 in favor of the documented consensus in bpo-16932 of how to treat strings without a // to designate the netloc. * bpo-22891: Remove urlsplit() optimization for 'http' prefixed inputs. (cherry picked from commit 5a88d50) Co-authored-by: Tim Graham <timograham@gmail.com>
* bpo-27657: Fix urlparse() with numeric paths Revert parsing decision from bpo-754016 in favor of the documented consensus in bpo-16932 of how to treat strings without a // to designate the netloc. * bpo-22891: Remove urlsplit() optimization for 'http' prefixed inputs. (cherry picked from commit 5a88d50) Co-authored-by: Tim Graham <timograham@gmail.com>
GH-16839 is a backport of this pull request to the 3.8 branch. |
* bpo-27657: Fix urlparse() with numeric paths Revert parsing decision from bpo-754016 in favor of the documented consensus in bpo-16932 of how to treat strings without a // to designate the netloc. * bpo-22891: Remove urlsplit() optimization for 'http' prefixed inputs. (cherry picked from commit 5a88d50) Co-authored-by: Tim Graham <timograham@gmail.com>
* bpo-27657: Fix urlparse() with numeric paths Revert parsing decision from bpo-754016 in favor of the documented consensus in bpo-16932 of how to treat strings without a // to designate the netloc. * bpo-22891: Remove urlsplit() optimization for 'http' prefixed inputs.
* bpo-27657: Fix urlparse() with numeric paths Revert parsing decision from bpo-754016 in favor of the documented consensus in bpo-16932 of how to treat strings without a // to designate the netloc. * bpo-22891: Remove urlsplit() optimization for 'http' prefixed inputs.
This reverts commit 82b5f6b. The change broke the backwards compatibility of parsing behavior in a patch release of Python (3.7.6). A decision was taken to revert this patch in 3.7.7. In https://bugs.python.org/issue27657 it was decided that the previous behavior like >>> urlparse('localhost:8080') ParseResult(scheme='', netloc='', path='localhost:8080', params='', query='', fragment='') >>> urlparse('undefined:8080') ParseResult(scheme='', netloc='', path='undefined:8080', params='', query='', fragment='') needs to be preserved in patch releases as number of users rely upon it. Explicitly mention the releases involved with the revert in NEWS. Adopt the wording suggested by @ned-deily.
Revert parsing decision from bpo-754016 in favor of the documented
consensus in bpo-16932 of how to treat strings without a // to
designate the netloc.
https://bugs.python.org/issue27657
https://bugs.python.org/issue754016
https://bugs.python.org/issue16932
https://bugs.python.org/issue27657