Message349917
| Author |
Ilya Konstantinov |
| Recipients |
Ilya Konstantinov, christian.heimes, martin.panter, nsonaniya2010, orsenthil, steven.daprano, xtreak |
| Date |
2019年08月18日.06:57:48 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1566111468.66.0.440908406399.issue35748@roundup.psfhosted.org> |
| In-reply-to |
| Content |
From RFC-1738:
hostname = *[ domainlabel "." ] toplabel
domainlabel = alphadigit | alphadigit *[ alphadigit | "-" ] alphadigit
toplabel = alpha | alpha *[ alphadigit | "-" ] alphadigit
alphadigit = alpha | digit
However:
py> urlparse('https://foo\\bar/baz')
ParseResult(scheme='https', netloc='foo\\bar', path='/baz', params='', query='', fragment='')
The hostname's BNF doesn't allow for a backslash ('\\') character, so I'd expect urlparse to raise a ValueError for this "URL". |
|