diff options
-rw-r--r-- | CHANGES | 16 | ||||
-rw-r--r-- | README.rst | 12 | ||||
-rw-r--r-- | __init__.py | 4 | ||||
-rw-r--r-- | _doc/_static/pypi.svg | 2 | ||||
-rw-r--r-- | _test/test_anchor.py | 2 | ||||
-rw-r--r-- | constructor.py | 4 | ||||
-rw-r--r-- | emitter.py | 2 |
7 files changed, 34 insertions, 8 deletions
@@ -1,3 +1,19 @@ +[0, 15, 75]: 2018-10-27 + - fix issue with single '?' scalar (reported by `Terrance + <https://bitbucket.org/OllieTerrance/>`__) + - fix issue with duplicate merge keys (prompted by `answering + <https://stackoverflow.com/a/52852106/1307905>`__ a + `StackOverflow question <https://stackoverflow.com/q/52851168/1307905>`__ + by `math <https://stackoverflow.com/users/1355634/math>`__) + +[0, 15, 75]: 2018-10-27 + - fix issue with single '?' scalar (reported by `Terrance + <https://bitbucket.org/OllieTerrance/>`__) + - fix issue with duplicate merge keys (prompted by `answering + <https://stackoverflow.com/a/52852106/1307905>`__ a + `StackOverflow question <https://stackoverflow.com/q/52851168/1307905>`__ + by `math <https://stackoverflow.com/users/1355634/math>`__) + [0, 15, 74]: 2018-10-17 - fix dropping of comment on rt before sequence item that is sequence item (reported by `Thorsten Kampe <https://bitbucket.org/thorstenkampe/>`__) @@ -4,8 +4,8 @@ ruamel.yaml ``ruamel.yaml`` is a YAML 1.2 loader/dumper package for Python. -:version: 0.15.74 -:updated: 2018-10-17 +:version: 0.15.75 +:updated: 2018-10-27 :documentation: http://yaml.readthedocs.io :repository: https://bitbucket.org/ruamel/ :pypi: https://pypi.org/project/ruamel.yaml/ @@ -54,6 +54,14 @@ ChangeLog .. should insert NEXT: at the beginning of line for next key (with empty line) +0.15.75 (2018-10-27): + - fix issue with single '?' scalar (reported by `Terrance + <https://bitbucket.org/OllieTerrance/>`__) + - fix issue with duplicate merge keys (prompted by `answering + <https://stackoverflow.com/a/52852106/1307905>`__ a + `StackOverflow question <https://stackoverflow.com/q/52851168/1307905>`__ + by `math <https://stackoverflow.com/users/1355634/math>`__) + 0.15.74 (2018-10-17): - fix dropping of comment on rt before sequence item that is sequence item (reported by `Thorsten Kampe <https://bitbucket.org/thorstenkampe/>`__) diff --git a/__init__.py b/__init__.py index 06c70a0..764755b 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, 74), - __version__='0.15.74', + version_info=(0, 15, 75), + __version__='0.15.75', 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/_doc/_static/pypi.svg b/_doc/_static/pypi.svg index 389f958..2aa33a3 100644 --- a/_doc/_static/pypi.svg +++ b/_doc/_static/pypi.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="86" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="86" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h33v20H0z"/><path fill="#007ec6" d="M33 0h53v20H33z"/><path fill="url(#b)" d="M0 0h86v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="175" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="230">pypi</text><text x="175" y="140" transform="scale(.1)" textLength="230">pypi</text><text x="585" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">0.15.74</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.15.74</text></g> </svg> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="86" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="86" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h33v20H0z"/><path fill="#007ec6" d="M33 0h53v20H33z"/><path fill="url(#b)" d="M0 0h86v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="175" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="230">pypi</text><text x="175" y="140" transform="scale(.1)" textLength="230">pypi</text><text x="585" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">0.15.75</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.15.75</text></g> </svg> diff --git a/_test/test_anchor.py b/_test/test_anchor.py index 4c7a9f2..dec1261 100644 --- a/_test/test_anchor.py +++ b/_test/test_anchor.py @@ -493,7 +493,7 @@ class TestDuplicateKeyThroughAnchor: def test_duplicate_key_01(self): # so issue https://stackoverflow.com/a/52852106/1307905 from ruamel.yaml import version_info - from ruamel.yaml.constructor import DuplicateKeyFutureWarning, DuplicateKeyError + from ruamel.yaml.constructor import DuplicateKeyError s = dedent("""\ - &name-name diff --git a/constructor.py b/constructor.py index 8600c9f..05fbb34 100644 --- a/constructor.py +++ b/constructor.py @@ -839,14 +839,14 @@ class Constructor(SafeConstructor): __import__(module_name) # object_name = '.'.join(object_name) break - except ImportError as exc: + except ImportError: continue else: module_name = builtins_module lobject_name = [name] try: __import__(module_name) - except ImportError as exc: + except ImportError: raise ConstructorError( 'while constructing a Python object', mark, @@ -1024,6 +1024,8 @@ class Emitter(object): if ch in u'?:': # ToDo if self.serializer.use_version == (1, 1): flow_indicators = True + elif len(scalar) == 1: # single character + flow_indicators = True if followed_by_whitespace: block_indicators = True if ch == u'-' and followed_by_whitespace: |