Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pydoc source not displayed in browser on Windows #66141

Closed
EricGalloway mannequin opened this issue Jul 9, 2014 · 3 comments
Closed

pydoc source not displayed in browser on Windows #66141

EricGalloway mannequin opened this issue Jul 9, 2014 · 3 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@EricGalloway
Copy link
Mannequin

EricGalloway mannequin commented Jul 9, 2014

BPO 21942
Nosy @zware
Files
  • diff.txt
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2014-07-10.16:25:13.893>
    created_at = <Date 2014-07-09.03:13:14.618>
    labels = ['type-bug', 'library']
    title = 'pydoc source not displayed in browser on Windows'
    updated_at = <Date 2014-07-10.16:25:13.891>
    user = 'https://bugs.python.org/EricGalloway'

    bugs.python.org fields:

    activity = <Date 2014-07-10.16:25:13.891>
    actor = 'zach.ware'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-07-10.16:25:13.893>
    closer = 'zach.ware'
    components = ['Library (Lib)']
    creation = <Date 2014-07-09.03:13:14.618>
    creator = 'Eric.Galloway'
    dependencies = []
    files = ['35910']
    hgrepos = []
    issue_num = 21942
    keywords = []
    message_count = 3.0
    messages = ['222599', '222675', '222676']
    nosy_count = 3.0
    nosy_names = ['python-dev', 'zach.ware', 'Eric.Galloway']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue21942'
    versions = ['Python 3.4', 'Python 3.5']

    @EricGalloway
    Copy link
    Mannequin Author

    EricGalloway mannequin commented Jul 9, 2014

    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

    1. 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.

    @EricGalloway EricGalloway mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jul 9, 2014
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 10, 2014

    New changeset 74c7a186ffdd by Zachary Ware in branch '3.4':
    Issue bpo-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 bpo-21942: Fixed source file viewing in pydoc's server mode on Windows.
    http://hg.python.org/cpython/rev/03b406f5aae0

    @zware
    Copy link
    Member

    zware commented Jul 10, 2014

    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.

    @zware zware closed this as completed Jul 10, 2014
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant