Message238246
| Author |
martin.panter |
| Recipients |
demian.brecht, martin.panter, orsenthil, soilandreyes |
| Date |
2015年03月16日.22:07:30 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1426543650.75.0.796896034366.issue22852@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
## Inferring flags ##
The whole reason for the has_netloc etc flags is that I don’t think we can always infer their values, so we have to explicitly remember them. Consider the following two URLs, which I think should both have empty "netloc" strings for backwards compatibility, but should be handled differently by urlunsplit():
>>> urlsplit("////evil.com").netloc
''
>>> urlsplit("////evil.com").has_netloc
True
>>> urlunsplit(urlsplit("////evil.com")) # Adds "//" back
'////evil.com'
>>> urlsplit("/normal/path").netloc
''
>>> urlsplit("/normal/path").has_netloc
False
>>> urlunsplit(urlsplit("/normal/path")) # Does not add "//"
'/normal/path'
## _NetlocResultMixinBase abuse ##
The _NetlocResultMixinBase class is a common class used by the four result classes I’m interested in. I probably should rename it to something like _SplitParseMixinBase, since it is the common base to both urlsplit() and urlparse() results. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2015年03月16日 22:07:30 | martin.panter | set | recipients:
+ martin.panter, orsenthil, demian.brecht, soilandreyes |
| 2015年03月16日 22:07:30 | martin.panter | set | messageid: <1426543650.75.0.796896034366.issue22852@psf.upfronthosting.co.za> |
| 2015年03月16日 22:07:30 | martin.panter | link | issue22852 messages |
| 2015年03月16日 22:07:30 | martin.panter | create |
|