mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #2684: sphinx.ext.intersphinx
crashes with six-1.4.1
This commit is contained in:
parent
65dddfcd69
commit
7586297d6d
1
CHANGES
1
CHANGES
@ -12,6 +12,7 @@ Bugs fixed
|
||||
|
||||
* #2676: (latex) Error with verbatim text in captions since Sphinx 1.4.4
|
||||
* #2629: memoir class crashes LaTeX. Fixed ``by latex_keep_old_macro_names=False`` (ref 2675)
|
||||
* #2684: `sphinx.ext.intersphinx` crashes with six-1.4.1
|
||||
|
||||
|
||||
Release 1.4.4 (released Jun 12, 2016)
|
||||
|
@ -34,7 +34,8 @@ from os import path
|
||||
import re
|
||||
|
||||
from six import iteritems, string_types
|
||||
from six.moves.urllib import parse, request
|
||||
from six.moves.urllib import request
|
||||
from six.moves.urllib.parse import urlsplit, urlunsplit
|
||||
from docutils import nodes
|
||||
from docutils.utils import relative_path
|
||||
|
||||
@ -145,7 +146,7 @@ def _strip_basic_auth(url):
|
||||
|
||||
:rtype: ``tuple``
|
||||
"""
|
||||
url_parts = parse.urlsplit(url)
|
||||
url_parts = urlsplit(url)
|
||||
username = url_parts.username
|
||||
password = url_parts.password
|
||||
frags = list(url_parts)
|
||||
@ -154,7 +155,7 @@ def _strip_basic_auth(url):
|
||||
frags[1] = "%s:%s" % (url_parts.hostname, url_parts.port)
|
||||
else:
|
||||
frags[1] = url_parts.hostname
|
||||
url = parse.urlunsplit(frags)
|
||||
url = urlunsplit(frags)
|
||||
return (url, username, password)
|
||||
|
||||
|
||||
@ -208,12 +209,12 @@ def _get_safe_url(url):
|
||||
url, username, _ = _strip_basic_auth(url)
|
||||
if username is not None:
|
||||
# case: url contained basic auth creds; obscure password
|
||||
url_parts = parse.urlsplit(url)
|
||||
url_parts = urlsplit(url)
|
||||
safe_netloc = '{0}@{1}'.format(username, url_parts.hostname)
|
||||
# replace original netloc w/ obscured version
|
||||
frags = list(url_parts)
|
||||
frags[1] = safe_netloc
|
||||
safe_url = parse.urlunsplit(frags)
|
||||
safe_url = urlunsplit(frags)
|
||||
|
||||
return safe_url
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user