Skip to content

Commit

Permalink
fix err on bad ML string
Browse files Browse the repository at this point in the history
  • Loading branch information
laktak committed Aug 18, 2016
1 parent c3abbe3 commit 58f1405
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 3 deletions.
2 changes: 2 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
@@ -1,5 1,7 @@
# History

- v2.0.2
- fix err on bad ML string
- v2.0.1
- move to hjson org
- v2.0.0
Expand Down
2 changes: 1 addition & 1 deletion hjson/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 36,7 @@
"""
from __future__ import absolute_import
__version__ = '2.0.1'
__version__ = '2.0.2'
__all__ = [
'dump', 'dumps', 'load', 'loads',
'dumpJSON', 'dumpsJSON',
Expand Down
2 changes: 1 addition & 1 deletion hjson/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 188,7 @@ def mlscanstring(s, end):

# When parsing multiline string values, we must look for ' characters
while 1:
ch = s[end]
ch = s[end:end 1]
if ch == '':
raise HjsonDecodeError("Bad multiline string", s, end);
elif ch == '\'':
Expand Down
4 changes: 4 additions & 0 deletions hjson/tests/assets/failKey4_test.hjson
Original file line number Diff line number Diff line change
@@ -0,0 1,4 @@
{
# invalid name
: 0
}
3 changes: 3 additions & 0 deletions hjson/tests/assets/failMLStr1_test.hjson
Original file line number Diff line number Diff line change
@@ -0,0 1,3 @@
{
# invalid multiline string
ml: '''
4 changes: 4 additions & 0 deletions hjson/tests/assets/failStr7_test.hjson
Original file line number Diff line number Diff line change
@@ -0,0 1,4 @@
{
# invalid \u char
char: "\uxxxx"
}
3 changes: 3 additions & 0 deletions hjson/tests/assets/testlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 31,8 @@ fail8_test.json
failKey1_test.hjson
failKey2_test.hjson
failKey3_test.hjson
failKey4_test.hjson
failMLStr1_test.hjson
failObj1_test.hjson
failObj2_test.hjson
failObj3_test.hjson
Expand All @@ -40,6 42,7 @@ failStr3_test.hjson
failStr4_test.hjson
failStr5_test.hjson
failStr6_test.hjson
failStr7_test.hjson
kan_test.hjson
keys_test.hjson
oa_test.hjson
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 10,7 @@
DistutilsPlatformError

IS_PYPY = hasattr(sys, 'pypy_translation_info')
VERSION = '2.0.1'
VERSION = '2.0.2'
DESCRIPTION = "JSON for Humans. A configuration file format with relaxed syntax, fewer mistakes and more comments."

with open('README.rst', 'r') as f:
Expand Down

0 comments on commit 58f1405

Please sign in to comment.