Skip to content

gh-96035: [urllib] Enforce that URL port numbers be digit strings #98270

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

Closed
wants to merge 1 commit into from
Closed

gh-96035: [urllib] Enforce that URL port numbers be digit strings #98270

wants to merge 1 commit into from

Conversation

kenballus
Copy link
Contributor

gh-96035: [urllib] Enforce that URL port numbers be digit strings

urllib.parse.urlparse currently parses port numbers with int, which accepts a lot more than just digit strings. (e.g. _ between digits, whitespace at the beginning and end, a '+' or '-' sign in the appropriate place)

This PR adds a check that port.isdigit() in the appropriate place, so only digit strings can be accepted as port numbers, as specified in RFC 3986.

@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@ghost
Copy link

ghost commented Oct 14, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@kenballus kenballus closed this Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants