Skip to content
Snippets Groups Projects
Commit 561bc4581343 authored by Bob Ippolito's avatar Bob Ippolito
Browse files

v3.0.6, fixes ensure_ascii=False regression (#50)

parent 4682e9d80cbb
No related merge requests found
Version 3.0.6 released 2013-01-11
* Fix for major Python 2.x ensure_ascii=False encoding regression
introduced in simplejson 3.0.0. If you use this setting, please
upgrade immediately.
https://github.com/simplejson/simplejson/issues/50
Version 3.0.5 released 2013-01-03
* NOTE: this release only changes the tests, it is
......
......@@ -44,7 +44,7 @@
# The short X.Y version.
version = '3.0'
# The full version, including alpha/beta/rc tags.
release = '3.0.5'
release = '3.0.6'
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
......
......@@ -8,7 +8,7 @@
DistutilsPlatformError
IS_PYPY = hasattr(sys, 'pypy_translation_info')
VERSION = '3.0.5'
VERSION = '3.0.6'
DESCRIPTION = "Simple, fast, extensible JSON encoder/decoder for Python"
with open('README.rst', 'r') as f:
......
......@@ -99,7 +99,7 @@
Expecting property name: line 1 column 2 (char 2)
"""
from __future__ import absolute_import
__version__ = '3.0.5'
__version__ = '3.0.6'
__all__ = [
'dump', 'dumps', 'load', 'loads',
'JSONDecoder', 'JSONDecodeError', 'JSONEncoder',
......
......@@ -15,7 +15,10 @@
from simplejson.decoder import PosInf
ESCAPE = re.compile(u(r'[\x00-\x1f\\"\b\f\n\r\t\u2028\u2029]'))
#ESCAPE = re.compile(ur'[\x00-\x1f\\"\b\f\n\r\t\u2028\u2029]')
# This is required because u() will mangle the string and ur'' isn't valid
# python3 syntax
ESCAPE = re.compile(u'[\\x00-\\x1f\\\\"\\b\\f\\n\\r\\t\u2028\u2029]')
ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])')
HAS_UTF8 = re.compile(r'[\x80-\xff]')
ESCAPE_DCT = {
......
......@@ -142,4 +142,15 @@
self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800\\ux000"')
# invalid value for low surrogate
self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800\\u0000"')
self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800\\ufc00"')
\ No newline at end of file
self.assertRaises(json.JSONDecodeError, json.loads, '"\\ud800\\ufc00"')
def test_ensure_ascii_still_works(self):
# in the ascii range, ensure that everything is the same
for c in map(unichr, range(0, 127)):
self.assertEqual(
json.dumps(c, ensure_ascii=False),
json.dumps(c))
snowman = u'\N{SNOWMAN}'
self.assertEqual(
json.dumps(c, ensure_ascii=False),
'"' + c + '"')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment