bpo-29651: Cover edge case of square brackets in urllib docs#1128
Conversation
Per bpo-29651, there is an edge case in urllib.parse where a ValueError will be returned if there are unmatched square brackets in the `netloc` attribute of a URL. This behavior is shown [here](https://github.com/python/cpython/blob/e32ec93/Lib/urllib/parse.py#L406-L408). This PR explicitly states this edge case in the docs.
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA. This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
|
small nit point: title bpo colon should have one space after it. |
|
Ah good call - thanks! |
berkerpeksag
left a comment
There was a problem hiding this comment.
Could you check that this behavior is tested in Lib/test/test_urlparse.py? If not, adding some tests with a comment and link to bpo-29651 would be great.
|
For sure - I'll try to push a commit out by this time tomorrow! Thanks for pointing me in the right direction. |
|
Another concern, should this documentation explain why unmatched square brackets return a |
|
@howinator - this looks good as it is. Thanks for the PR. |
Per bpo-29651, there is an edge case in urllib.parse where a ValueError
will be returned if there are unmatched square brackets in the
netlocattribute of a URL. This behavior is shown here.
This PR explicitly states this edge case in the docs.