Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[3.9] bpo-43882 Remove the newline, and tab early. From query and fragments.#25853

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
orsenthil merged 2 commits intopython:3.9fromorsenthil:issue43882_39
May 3, 2021
Merged

[3.9] bpo-43882 Remove the newline, and tab early. From query and fragments.#25853

orsenthil merged 2 commits intopython:3.9fromorsenthil:issue43882_39
May 3, 2021

Conversation

orsenthil
Copy link
Member

@orsenthilorsenthil commentedMay 3, 2021
edited by bedevere-bot
Loading

Based on the review comment#25726 (review)

Moving the fix for removing newline and tabs early to include both query strings and fragments, (Entire URL).

https://bugs.python.org/issue43882

@orsenthilorsenthil requested a review fromgpsheadMay 3, 2021 14:09
@orsenthilorsenthil changed the titlebpo-43882 Remove the newline, and tab early. From query and fragments.[3.9] bpo-43882 Remove the newline, and tab early. From query and fragments.May 3, 2021
@@ -614,32 +614,40 @@ def test_urlsplit_attributes(self):

def test_urlsplit_remove_unsafe_bytes(self):
# Remove ASCII tabs and newlines from input
url = "http://www.python.org/java\nscript:\talert('msg\r\n')/#frag"
url = "http\t://www.python.org/java\nscript:\talert('msg\r\n')/?query\n=\tsomething#frag\nment"
Copy link
Member

Choose a reason for hiding this comment

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

i suggest also adding a \r in the middle of the netloc for good measure.www.python\r.org perhaps?

@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment:I have made the requested changes; please review again.

@gpshead
Copy link
Member

fwiw this PR is against 3.9. i assume you'll "backport to main and 3.10" once those aren't actively being release branched and renamed?

@orsenthil
Copy link
MemberAuthor

i assume you'll "backport to main and 3.10" once those aren't actively being release branched and renamed?

Yes, exactly. I wanted to time window to be utilized for 3.9 and 3.8.
I will port it to rest of the active branches immediately.

gpshead reacted with thumbs up emoji

@orsenthilorsenthil merged commit8a59574 intopython:3.9May 3, 2021
@bedevere-bot
Copy link

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


for b in _UNSAFE_URL_BYTES_TO_REMOVE:
url = url.replace(b, "")
scheme = scheme.replace(b, "")
Copy link
Contributor

Choose a reason for hiding this comment

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

According to thetypeshed, thescheme argument tourlparse isOptional. However, with this change, a value ofNone will result in an error like:

AttributeError: 'NoneType' object has no attribute 'replace'

I'm not sure whether the typeshed is wrong or if this line should be guarded withif scheme is not None, but we should definitely fix one or the other and perhaps improve the documentation on this option.

Thanks to@branchvincent for doing the digging and reporting this issue to me.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@adamjstewartadamjstewartadamjstewart left review comments

@gpsheadgpsheadgpshead approved these changes

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@orsenthil@bedevere-bot@gpshead@adamjstewart@the-knights-who-say-ni

[8]ページ先頭

©2009-2025 Movatter.jp