Serhiy Storchaka added the comment: 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. ---------- keywords: +patch stage: -> patch review Added file: http://bugs.python.org/file40534/pydoc_undecodabple_path.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25184> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com