This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: pydoc source not displayed in browser on Windows
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Eric.Galloway, python-dev, zach.ware
Priority: normal Keywords:

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:05adminsetgithub: 66141
2014-07-10 16:25:13zach.waresetstatus: open -> closed

versions: - Python 3.3
nosy: + zach.ware

messages: + msg222676
resolution: fixed
stage: resolved
2014-07-10 16:21:56python-devsetnosy: + python-dev
messages: + msg222675
2014-07-09 03:13:14Eric.Gallowaycreate