On May 11, 2020, at 12:59, Barry Scott <[email protected]> wrote: > > >> On 11 May 2020, at 18:09, Andrew Barnert via Python-ideas >> <[email protected]> wrote: >> >> More generally, what’s the use case for %-encoding filenames like this? Are >> people expecting it to interact transparently with URLs, so if I save a file >> “spam\0eggs” in a Python script and then try to browse to >> file:///spam\0eggs” in a browser, the browser will convert the \0 character >> to %00 the same way my Python script did and therefore find the file? > > No. > > The \0 can never be part of a valid file in Unix, macOS or Windows.
Of course. Which is exactly the kind of thing this sanitize function is meant for. Hence my question: if my Python script is sanitizing all filenames with this function with escape='%', is the expectation that it’ll actually give me something that can be used if I paste the same thing into a browser and let it url-escape a file URL? If so, will that actually work? If not, what _is_ the intended use for this option?
_______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/CMYTQZQHSALH4ZREIMTDMFLYMJXWSPG3/ Code of Conduct: http://python.org/psf/codeofconduct/
