From: Julien Palard Date: Mon, 25 Jan 2021 14:50:14 +0000 (+0100) Subject: bpo-42869: Avoid an HTTP redirection. (GH-24174) X-Git-Tag: v3.10.0a5~51 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eb9983c59b0683270328b5c40a115bb028209511;p=thirdparty%2FPython%2Fcpython.git bpo-42869: Avoid an HTTP redirection. (GH-24174) --- diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 628f9fc7d1d1..282a91799834 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -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: