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.

Author mdk
Recipients docs@python, mdk
Date 2021-01-08.21:55:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1610142955.15.0.664460414569.issue42869@roundup.psfhosted.org>
In-reply-to
Content
Running `python3 -m pydoc ensurepip` gives me:

https://docs.python.org/3.9/library/ensurepip
but it should be:

https://docs.python.org/3.9/library/ensurepip.html

Issue is in getdocloc function on the line:

    docloc = "%s/%s" % (docloc.rstrip("/"), object.__name__.lower())

But it previously worked as the nginx config for the doc server contains:

    # Emulate Apache's content-negotiation. Was a temporary measure,
    # but now people are using it like a feature.
    location ~ ^/((2|3)(\.[0-8])?|dev)/\w+/[\d\w\.]+(?!\.html)$ {
        if (-f "${request_filename}.html") {
            return 301 https://$host:$request_uri.html;
        }
    }

(So yes "people are using it like a feature" contains pydoc :))

Notice the [0-8], which does not match for my /3.9/.

I propose to fix the issue on both sides:
- On psf-salt to allow 3.9 to get the "temporary" measure.
- pydoc side to simplify the code
History
Date User Action Args
2021-01-08 21:55:55mdksetrecipients: + mdk, docs@python
2021-01-08 21:55:55mdksetmessageid: <1610142955.15.0.664460414569.issue42869@roundup.psfhosted.org>
2021-01-08 21:55:55mdklinkissue42869 messages
2021-01-08 21:55:55mdkcreate