Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
simplejson
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
Python
Modules
simplejson
Commits
a1c439bbb9d8
Commit
a1c439bbb9d8
authored
13 years ago
by
Bob Ippolito
Browse files
Options
Downloads
Patches
Plain Diff
also test unicode and fix the JSONDecodeError issue
parent
e1ff40afda1f
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGES.txt
+3
-0
3 additions, 0 deletions
CHANGES.txt
simplejson/_speedups.c
+8
-2
8 additions, 2 deletions
simplejson/_speedups.c
simplejson/tests/test_errors.py
+9
-8
9 additions, 8 deletions
simplejson/tests/test_errors.py
with
20 additions
and
10 deletions
CHANGES.txt
+
3
−
0
View file @
a1c439bb
Version 2.1.7 released 2011-XX-XX
Version 2.1.7 released 2011-XX-XX
* JSONDecodeError is now raised instead of ValueError when a document
ends with an opening quote and the C speedups are in use.
https://github.com/simplejson/simplejson/issues/15
* Updated documentation with information about JSONDecodeError
* Updated documentation with information about JSONDecodeError
* Force unicode linebreak characters to be escaped (U+2028 and U+2029)
* Force unicode linebreak characters to be escaped (U+2028 and U+2029)
http://timelessrepo.com/json-isnt-a-javascript-subset
http://timelessrepo.com/json-isnt-a-javascript-subset
...
...
This diff is collapsed.
Click to expand it.
simplejson/_speedups.c
+
8
−
2
View file @
a1c439bb
...
@@ -483,7 +483,10 @@
...
@@ -483,7 +483,10 @@
PyObject
*
chunks
=
NULL
;
PyObject
*
chunks
=
NULL
;
PyObject
*
chunk
=
NULL
;
PyObject
*
chunk
=
NULL
;
if
(
end
<
0
||
len
<=
end
)
{
if
(
len
==
end
)
{
raise_errmsg
(
"Unterminated string starting at"
,
pystr
,
begin
);
}
else
if
(
end
<
0
||
len
<
end
)
{
PyErr_SetString
(
PyExc_ValueError
,
"end is out of bounds"
);
PyErr_SetString
(
PyExc_ValueError
,
"end is out of bounds"
);
goto
bail
;
goto
bail
;
}
}
...
@@ -689,7 +692,10 @@
...
@@ -689,7 +692,10 @@
PyObject
*
chunks
=
NULL
;
PyObject
*
chunks
=
NULL
;
PyObject
*
chunk
=
NULL
;
PyObject
*
chunk
=
NULL
;
if
(
end
<
0
||
len
<=
end
)
{
if
(
len
==
end
)
{
raise_errmsg
(
"Unterminated string starting at"
,
pystr
,
begin
);
}
else
if
(
end
<
0
||
len
<
end
)
{
PyErr_SetString
(
PyExc_ValueError
,
"end is out of bounds"
);
PyErr_SetString
(
PyExc_ValueError
,
"end is out of bounds"
);
goto
bail
;
goto
bail
;
}
}
...
...
This diff is collapsed.
Click to expand it.
simplejson/tests/test_errors.py
+
9
−
8
View file @
a1c439bb
...
@@ -22,4 +22,5 @@
...
@@ -22,4 +22,5 @@
def
test_scan_error
(
self
):
def
test_scan_error
(
self
):
err
=
None
err
=
None
for
t
in
(
str
,
unicode
):
try
:
try
:
...
@@ -25,5 +26,5 @@
...
@@ -25,5 +26,5 @@
try
:
try
:
json
.
loads
(
'
{
"
asdf
"
:
"'
)
json
.
loads
(
t
(
'
{
"
asdf
"
:
"'
)
)
except
json
.
JSONDecodeError
,
e
:
except
json
.
JSONDecodeError
,
e
:
err
=
e
err
=
e
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment