Issue 21942: pydoc source not displayed in browser on Windows (original) (raw)

Issue21942

Created on 2014-07-09 03:13 by Eric.Galloway, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
diff.txt Eric.Galloway,2014-07-09 03:13
Messages (3)
msg222599 - (view) Author: Eric Galloway (Eric.Galloway) * Date: 2014-07-09 03:13
In Python 3 on Windows, pydoc fails to display source file listings in the browser. To reproduce in Python 3.4: 1. start pydoc: python -m pydoc -p 8888 2. Navigate to the url: http://127.0.0.1:8888/getfile?key=///C:/python34/lib/pydoc.py The error message: getfile?key=///C:/python34/lib/pydoc.py FileNotFoundError: [Errno 2] No such file or directory: '///C:/python34/lib/pydoc.py' The url passed to html_getfile needs to be converted into a NT pathname.
msg222675 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-07-10 16:21
New changeset 74c7a186ffdd by Zachary Ware in branch '3.4': Issue #21942: Fixed source file viewing in pydoc's server mode on Windows. http://hg.python.org/cpython/rev/74c7a186ffdd New changeset 03b406f5aae0 by Zachary Ware in branch 'default': Issue #21942: Fixed source file viewing in pydoc's server mode on Windows. http://hg.python.org/cpython/rev/03b406f5aae0
msg222676 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2014-07-10 16:25
Fixed, thanks for the report! I took an alternate approach to fixing the problem; nturl2path was only used at all because pydoc used to produce actual "file://" links rather than rendering the page itself, and there's no reason to use nturl2path if you're not making a "file://" link.
History
Date User Action Args
2022-04-11 14:58:05 admin set github: 66141
2014-07-10 16:25:13 zach.ware set status: open -> closedversions: - Python 3.3nosy: + zach.waremessages: + resolution: fixedstage: resolved
2014-07-10 16:21:56 python-dev set nosy: + python-devmessages: +
2014-07-09 03:13:14 Eric.Galloway create