Message251226
We could use url = urllib.parse.quote_from_bytes(os.fsencode(path)) on Posix systems, but I heart that on Windows os.fsencode() can irreversible spoil file names (replace unencodable characters with '?'). On other side, I'm not sure that Windows unicode path can't contain lone surrogates. In this case we should use the 'surrogatepass' error handler (at least it allow to restore the path in principle).
Here is a patch that tries to handle undecodable and unencodable paths. Need to test it on Windows. |
|
Date |
User |
Action |
Args |
2015-09-21 13:37:36 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, orsenthil, vstinner, Arfrever, martin.panter |
2015-09-21 13:37:36 | serhiy.storchaka | set | messageid: <1442842656.34.0.749769588877.issue25184@psf.upfronthosting.co.za> |
2015-09-21 13:37:36 | serhiy.storchaka | link | issue25184 messages |
2015-09-21 13:37:36 | serhiy.storchaka | create | |
|