Skip to content
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

[3.8] bpo-27657: Fix urlparse() with numeric paths (GH-661) #16839

Merged
merged 1 commit into from
Oct 18, 2019

Conversation

orsenthil
Copy link
Member

@orsenthil orsenthil commented Oct 18, 2019

  • 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

https://bugs.python.org/issue27657

* 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>
@orsenthil
Copy link
Member Author

This is a backport PR. Merging this.

@orsenthil orsenthil merged commit 0f3187c into 3.8 Oct 18, 2019
@orsenthil orsenthil deleted the backport-5a88d50-3.8 branch October 18, 2019 15:23
@bedevere-bot
Copy link

@orsenthil: Please replace # with GH- in the commit message next time. Thanks!

@Ma27
Copy link

Ma27 commented Dec 21, 2019

This is a backport PR. Merging this.

May I ask why this was backported into Python 3.8.1? I totally understand the motivation behind this change, but isn't it a breaking change in a patch release?

To quote an older comment from the original issue (bpo-27657):

I hate to say it, but this may require a python-dev discussion.

I observed a certain fallout from this change (e.g. mozilla/bleach#503), so is there any chance that this gets reverted in python 3.8.2 or do you have any suggestions how to properly deal with cases like localhost:8080?

@orsenthil
Copy link
Member Author

orsenthil commented Jan 4, 2020

Hi @Ma27 - I re-read the whole issue again, I see that this message https://bugs.python.org/issue27657#msg289557 and the Versions in the issue set played a role in 'reverting' the patch or making the change in a patch release.

This seems like a mistake when a simple path like localhost:8080 could fail in a patch release of Python. I apologize that this was not considered properly.

Let's continue the discussion on https://bugs.python.org/issue27657 on the next steps. If this needs to be reverted again for the patch release. I will re-read associated issues again and share the possible next steps.

orsenthil added a commit that referenced this pull request Feb 16, 2020
orsenthil added a commit that referenced this pull request Feb 16, 2020
GH-18525)

This reverts commit 0f3187c.

The change broke the backwards compatibility of parsing behavior in a
patch release of Python (3.8.1). A decision was taken to revert this
patch in 3.8.2.

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.
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.

None yet

5 participants