]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-42869: Avoid an HTTP redirection. (GH-24174)
authorJulien Palard <julien@palard.fr>
Mon, 25 Jan 2021 14:50:14 +0000 (15:50 +0100)
committerGitHub <noreply@github.com>
Mon, 25 Jan 2021 14:50:14 +0000 (15:50 +0100)
Lib/pydoc.py

index 628f9fc7d1d1efd3938adf39fca29cc316e6e2ab..282a9179983407a4610a195320ee95812c2c4476 100755 (executable)
@@ -504,7 +504,7 @@ class Doc:
               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: