Message252079
| Author |
martin.panter |
| Recipients |
BreamoreBoy, chin, gregory.p.smith, martin.panter, orsenthil, r.david.murray |
| Date |
2015年10月02日.03:05:54 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1443755155.11.0.581958086658.issue5714@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Some ideas for this sort of function (or perhaps a few related functions):
* Allow OS-independent handling of the path. E.g. the CGI server still has to check if each segment is a CGI script, the rest becomes PATH_INFO. Perhaps return a sequence of path segments rather than a string.
* Allow easy conversion to a valid OS path (or perhaps a pathlib object)
* Ensure that invalid and special OS filenames trigger an error (e.g. "NUL" or unsupported characters, including backslashes ,円 on Windows). Like a stricter version of pathlib’s is_reserved().
* Handle percent decoding
Also, see the SimpleHTTPRequestHandler.translate_path() method, and Issue 14567. There seems to be a lot of redundancy. |
|