[Python-checkins] bpo-42869: Avoid an HTTP redirection. (GH-24174)

JulienPalard webhook-mailer at python.org
Mon Jan 25 09:50:23 EST 2021


https://github.com/python/cpython/commit/eb9983c59b0683270328b5c40a115bb028209511
commit: eb9983c59b0683270328b5c40a115bb028209511
branch: master
author: Julien Palard <julien at palard.fr>
committer: JulienPalard <julien at palard.fr>
date: 2021-01-25T15:50:14+01:00
summary:

bpo-42869: Avoid an HTTP redirection. (GH-24174)

files:
M Lib/pydoc.py

diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 628f9fc7d1d1e..282a917998340 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -504,7 +504,7 @@ def getdocloc(self, object, basedir=sysconfig.get_path('stdlib')):
               not file.startswith(os.path.join(basedir, 'site-packages')))) and
             object.__name__ not in ('xml.etree', 'test.pydoc_mod')):
             if docloc.startswith(("http://", "https://")):
-                docloc = "%s/%s" % (docloc.rstrip("/"), object.__name__.lower())
+                docloc = "{}/{}.html".format(docloc.rstrip("/"), object.__name__.lower())
             else:
                 docloc = os.path.join(docloc, object.__name__.lower() + ".html")
         else:



More information about the Python-checkins mailing list