[issue42869] pydoc does not append .html to documentation
New submission from Julien Palard <julien+python@palard.fr>: 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 ---------- assignee: docs@python components: Documentation messages: 384693 nosy: docs@python, mdk priority: normal severity: normal status: open title: pydoc does not append .html to documentation versions: Python 3.9 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue42869> _______________________________________
Change by Julien Palard <julien+python@palard.fr>: ---------- keywords: +patch pull_requests: +23001 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24174 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue42869> _______________________________________
Julien Palard <julien+python@palard.fr> added the comment: This is now fixed on the docs server thanks to [1], so it should work for already release Python 3.9 :) [1]: https://github.com/python/psf-salt/pull/198 I still did a PR on cpython to avoid a redirection, and get cpython itself out of the "people use this temporary fix as a feature now". ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue42869> _______________________________________
Julien Palard <julien+python@palard.fr> added the comment: New changeset eb9983c59b0683270328b5c40a115bb028209511 by Julien Palard in branch 'master': bpo-42869: Avoid an HTTP redirection. (GH-24174) https://github.com/python/cpython/commit/eb9983c59b0683270328b5c40a115bb0282... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue42869> _______________________________________
Change by Julien Palard <julien+python@palard.fr>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue42869> _______________________________________
participants (1)
-
Julien Palard