#2902: jsdump.loads fails to load search index if keywords starts with underscore

This commit is contained in:
Takeshi KOMIYA 2016-08-27 15:28:36 +09:00
parent 52f4c07202
commit acd4d9f2ba
3 changed files with 7 additions and 1 deletions

View File

@ -7,6 +7,8 @@ Bugs fixed
* #2870: flatten genindex columns' heights.
* #2856: Search on generated HTML site doesnt find some symbols
* #2882: Fall back to a GET request on 403 status in linkcheck
* #2902: jsdump.loads fails to load search index if keywords starts with
underscore
Release 1.4.6 (released Aug 20, 2016)
=====================================

View File

@ -18,7 +18,7 @@ from sphinx.util.pycompat import u
_str_re = re.compile(r'"(\\\\|\\"|[^"])*"')
_int_re = re.compile(r'\d+')
_name_re = re.compile(r'[a-zA-Z]\w*')
_name_re = re.compile(r'[a-zA-Z_]\w*')
_nameonly_re = re.compile(r'[a-zA-Z_][a-zA-Z0-9_]*$')
# escape \, ", control characters and everything outside ASCII

View File

@ -14,3 +14,7 @@ def test_jsdump():
data = {u'a\xe8': 1}
assert dumps(data) == '{"a\\u00e8":1}'
assert data == loads(dumps(data))
data = {'_foo': 1}
assert dumps(data) == '{_foo:1}'
assert data == loads(dumps(data))