summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-06-12 04:31:25 +0000
committerMartin Panter <vadmium+py@gmail.com>2016-06-12 04:31:25 +0000
commit52855452711eb2df1900470d387b58dede3ac941 (patch)
treebe6b2bd2fac48172eed302d9a2f2624c844e2926
parent62bdea58c59b4377aaf0c40c9fb7c0db21d4cffd (diff)
parent4f8aaf644095fef61ba1104af0f07efe2a099079 (diff)
downloadcpython-git-52855452711eb2df1900470d387b58dede3ac941.tar.gz
Issue #16484: Merge pydoc Windows fixes from 3.5
-rw-r--r--Lib/pydoc.py5
-rw-r--r--Lib/test/test_pydoc.py2
-rw-r--r--Misc/NEWS4
3 files changed, 8 insertions, 3 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 85000fe206..063aa9cf07 100644
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -28,7 +28,7 @@ to a file named "<name>.html".
Module docs for core modules are assumed to be in
- http://docs.python.org/X.Y/library/
+ https://docs.python.org/X.Y/library/
This can be overridden by setting the PYTHONDOCS environment variable
to a different URL or to a local directory containing the Library
@@ -407,6 +407,7 @@ class Doc:
docloc = os.environ.get("PYTHONDOCS", self.PYTHONDOCS)
+ basedir = os.path.normcase(basedir)
if (isinstance(object, type(os)) and
(object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
'marshal', 'posix', 'signal', 'sys',
@@ -414,7 +415,7 @@ class Doc:
(file.startswith(basedir) and
not file.startswith(os.path.join(basedir, 'site-packages')))) and
object.__name__ not in ('xml.etree', 'test.pydoc_mod')):
- if docloc.startswith("http://"):
+ if docloc.startswith(("http://", "https://")):
docloc = "%s/%s" % (docloc.rstrip("/"), object.__name__.lower())
else:
docloc = os.path.join(docloc, object.__name__.lower() + ".html")
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index 9a357da59b..889ce592db 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -356,7 +356,7 @@ def get_pydoc_html(module):
def get_pydoc_link(module):
"Returns a documentation web link of a module"
dirname = os.path.dirname
- basedir = os.path.join(dirname(dirname(__file__)))
+ basedir = dirname(dirname(__file__))
doc = pydoc.TextDoc()
loc = doc.getdocloc(module, basedir=basedir)
return loc
diff --git a/Misc/NEWS b/Misc/NEWS
index 1702876cc9..0342fcfc9c 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -225,6 +225,10 @@ IDLE
Documentation
-------------
+- Issue #16484: Change the default PYTHONDOCS URL to "https:", and fix the
+ resulting links to use lowercase. Patch by Sean Rodman, test by Kaushik
+ Nadikuditi.
+
- Issue #24136: Document the new PEP 448 unpacking syntax of 3.5.
- Issue #22558: Add remaining doc links to source code for Python-coded modules.