Skip to content

[2.7] bpo-36742: Fixes handling of pre-normalization characters in urlsplit() (GH-13017) #13025

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

Merged
merged 3 commits into from
May 1, 2019

Conversation

zooba
Copy link
Member

@zooba zooba commented Apr 30, 2019

@@ -641,6 +641,12 @@ def test_urlsplit_normalization(self):
self.assertIn(u'\u2100', denorm_chars)
self.assertIn(u'\uFF03', denorm_chars)

# bpo-36742: Verify port separators are ignored when they
# existed prior to decomposition
urllib.parse.urlsplit('http://\u30d5\u309a:80')
Copy link
Member

Choose a reason for hiding this comment

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

I guess the Python 3 patch applied here. urlunparse.urlsplit could be the correct function for this test.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, you're right. Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

You're welcome. There is some test error on CI :

test test_urlparse failed -- Traceback (most recent call last):
  File "/home/travis/build/python/cpython/Lib/test/test_urlparse.py", line 648, in test_urlsplit_normalization
    urlparse.urlsplit('http://\u30d5\u309a\ufe1380')
AssertionError: ValueError not raised

Copy link
Member

Choose a reason for hiding this comment

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

Ah I guess u"" prefix is missing since it's Python 2 ? Adding it makes the tests to pass locally for the PR.

Copy link
Member

@tirkarthi tirkarthi left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

@zooba zooba merged commit 98a4dce into python:2.7 May 1, 2019
@zooba zooba deleted the bpo-36742-2.7 branch May 1, 2019 15:00
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.

4 participants