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

2018-12-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.7, Python 3.8 -Python 3.4, Python 3.5, Python 3.6 ___ Python tracker ___ ___

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

2018-12-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please create a PR for your path Martin? -- ___ Python tracker ___ ___

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

2015-09-30 Thread Martin Panter
Martin Panter added the comment: Here is a patch that implements my IRI (Unicode URL) proposal. Differences compared to Serhiy’s patches: * “file:” URLs use Unicode if possible. Percent encode encoding only used for reserved ASCII characters and undecodable bytes. * HTTP URLs use UTF-8 and

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

2015-09-27 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +pitrou ___ Python tracker ___ ___

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

2015-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, perhaps using pathlib is more correct. Updated patch uses pathlib. Can you please test it on Windows? Can filenames on Windows contain lone surrogates? -- Added file: http://bugs.python.org/file40600/pydoc_undecodabple_path_2.patch

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

2015-09-27 Thread Martin Panter
Martin Panter added the comment: I don’t have much to do with Windows, but I understand we don’t support surrogate-escaped bytes there. E.g. see and sys.getfilesystemencoding(). However I suspect your first patch would have failed on

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

2015-09-21 Thread STINNER Victor
STINNER Victor added the comment: Technically, I think that it's possible to put bytes in an URL using %HH format. I didn't check if we can retrieve the "raw bytes". -- nosy: +haypo ___ Python tracker

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

2015-09-21 Thread Martin Panter
Martin Panter added the comment: Seems to be caused by the Python directory being non-decodable; the current working directory does not matter. What is going on is “pydoc” is trying to make a link to a module’s source code, such as /usr/lib/python3.4/pydoc.py For non-decodable paths, the

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

2015-09-21 Thread Serhiy Storchaka
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

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

2015-09-21 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___

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

2015-09-21 Thread Martin Panter
Martin Panter added the comment: Serhiy’s patch essentially uses the local filesystem encoding and then percent encoding, rather than the current behaviour of strict UTF-8 encoding and percent encoding. This is similar to what the “pathlib” make_uri() methods do, so maybe we could let

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

2015-09-19 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: $ pwd /home/serhiy/py/cpy�thon-3.5 $ ./python -m pydoc -w pydoc Traceback (most recent call last): File "/home/serhiy/py/cpy\udcffthon-3.5/Lib/runpy.py", line 170, in _run_module_as_main "__main__", mod_spec) File