summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2017-08-14 22:26:01 +0200
committerAnthon van der Neut <anthon@mnt.org>2017-08-14 22:26:01 +0200
commitcddd031430973470cefd7412c76bd633233569bb (patch)
treeee451fffd663a6c60b9154657143d01fe82cc505
parent82451b513ea33cce3f228216d5b99b8c046cf182 (diff)
downloadruamel.yaml-cddd031430973470cefd7412c76bd633233569bb.tar.gz
fix for '{"in":{},"out":{}}' no longer parsing, reported by mjalkio on so0.15.30
-rw-r--r--CHANGES5
-rw-r--r--README.rst9
-rw-r--r--__init__.py4
-rw-r--r--_test/test_indentation.py3
-rw-r--r--_test/test_version.py6
-rw-r--r--scanner.py2
6 files changed, 21 insertions, 8 deletions
diff --git a/CHANGES b/CHANGES
index 983623a..9d00d1e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+[0, 15, 30]: 2017-08-14
+ - fix for issue with "compact JSON" not parsing: ``{"in":{},"out":{}}``
+ (reported on `StackOverflow <https://stackoverflow.com/q/45681626/1307905>`_ by
+ `mjalkio <https://stackoverflow.com/users/5130525/mjalkio>`_
+
[0, 15, 29]: 2017-08-14
- fix issue #51: different indents for mappings and sequences (reported by
Alex Harvey)
diff --git a/README.rst b/README.rst
index 09d7b32..4f1c415 100644
--- a/README.rst
+++ b/README.rst
@@ -35,10 +35,15 @@ ChangeLog
.. should insert NEXT: at the beginning of line for next key
+0.15.30 (2017-08-14):
+ - fix for issue with "compact JSON" not parsing: ``{"in":{},"out":{}}``
+ (reported on `StackOverflow <https://stackoverflow.com/q/45681626/1307905>`_ by
+ `mjalkio <https://stackoverflow.com/users/5130525/mjalkio>`_
+
0.15.29 (2017-08-14):
- - fix issue #51: different indents for mappings and sequences (reported by
+ - fix issue #51: different indents for mappings and sequences (reported by
Alex Harvey)
- - fix for flow sequence/mapping as element/value of block sequence with
+ - fix for flow sequence/mapping as element/value of block sequence with
sequence-indent minus dash-offset not equal two.
0.15.28 (2017-08-13):
diff --git a/__init__.py b/__init__.py
index 88730b4..8fd81f8 100644
--- a/__init__.py
+++ b/__init__.py
@@ -7,8 +7,8 @@ if False: # MYPY
_package_data = dict(
full_package_name='ruamel.yaml',
- version_info=(0, 15, 29),
- __version__='0.15.29',
+ version_info=(0, 15, 30),
+ __version__='0.15.30',
author='Anthon van der Neut',
author_email='a.van.der.neut@ruamel.eu',
description='ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order', # NOQA
diff --git a/_test/test_indentation.py b/_test/test_indentation.py
index 4e991fd..014f89b 100644
--- a/_test/test_indentation.py
+++ b/_test/test_indentation.py
@@ -298,8 +298,7 @@ class TestSeparateMapSeqIndents:
def test_issue_51(self):
yaml = YAML()
# yaml.map_indent = 2 # the default
- yaml.sequence_indent = 4
- yaml.sequence_dash_offset = 2
+ yaml.indent(sequence=4, offset=2)
yaml.preserve_quotes = True
yaml.round_trip("""
role::startup::author::rsyslog_inputs:
diff --git a/_test/test_version.py b/_test/test_version.py
index 795c242..0c270d7 100644
--- a/_test/test_version.py
+++ b/_test/test_version.py
@@ -3,7 +3,7 @@
import pytest # NOQA
import ruamel.yaml
-from roundtrip import dedent, round_trip
+from roundtrip import dedent, round_trip, round_trip_load
def load(s, version=None):
@@ -149,3 +149,7 @@ class TestIssue62:
round_trip(s.format(''), preserve_quotes=True)
# note the flow seq on the --- line!
round_trip(s.format('%YAML 1.2\n--- '), preserve_quotes=True, version="1.2")
+
+ def test_so_45681626(self):
+ # was not properly parsing
+ round_trip_load('{"in":{},"out":{}}')
diff --git a/scanner.py b/scanner.py
index 9710b1e..5e4dccf 100644
--- a/scanner.py
+++ b/scanner.py
@@ -765,7 +765,7 @@ class Scanner(object):
if bool(self.flow_level):
return True
else:
- if bool(self.flow_level) and self.reader.peek(1) in '\'"':
+ if bool(self.flow_level) and self.reader.peek(1) in '\'"{[]}':
return True
# VALUE(block context): ':' (' '|'\n')
return self.reader.peek(1) in _THE_END_SPACE_TAB