[issue25184] "python -m pydoc -w" fails in nondecodable directory

Serhiy Storchaka report at bugs.python.org
Mon Sep 21 15:37:36 CEST 2015


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 <report at bugs.python.org>
<http://bugs.python.org/issue25184>
_______________________________________


More information about the Python-bugs-list mailing list