Skip to content

Commit 37882b9

Browse files
committed
Fix #2518: intersphinx_mapping disallows non alphanumeric keys
1 parent 9546fda commit 37882b9

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Bugs fixed
5959
* #2521: generated Makefile causes BSD make crashed if sphinx-build not found
6060
* #2470: ``typing`` backport package causes autodoc errors with python 2.7
6161
* ``sphinx.ext.intersphinx`` crashes if non-string value is used for key of `intersphinx_mapping`
62+
* #2518: `intersphinx_mapping` disallows non alphanumeric keys
6263

6364

6465
Release 1.4.1 (released Apr 12, 2016)

sphinx/ext/intersphinx.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,6 @@ def load_mappings(app):
274274
if not isinstance(name, string_types):
275275
app.warn('intersphinx identifier %r is not string. Ignored' % name)
276276
continue
277-
elif not name.isalnum():
278-
app.warn('intersphinx identifier %r is not alphanumeric' % name)
279277
else:
280278
# old format, no name
281279
name, uri, inv = None, key, value

tests/test_ext_intersphinx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def reference_check(*args, **kwds):
161161
def test_load_mappings_warnings(tempdir, app, status, warning):
162162
"""
163163
load_mappings issues a warning if new-style mapping
164-
identifiers are not alphanumeric
164+
identifiers are not string
165165
"""
166166
inv_file = tempdir / 'inventory'
167167
inv_file.write_bytes(inventory_v2)
@@ -177,7 +177,7 @@ def test_load_mappings_warnings(tempdir, app, status, warning):
177177
app.config.intersphinx_cache_limit = 0
178178
# load the inventory and check if it's done correctly
179179
load_mappings(app)
180-
assert warning.getvalue().count('\n') == 3
180+
assert warning.getvalue().count('\n') == 1
181181

182182

183183
class TestStripBasicAuth(unittest.TestCase):

0 commit comments

Comments
 (0)