diff options
-rw-r--r-- | CHANGES | 5 | ||||
-rw-r--r-- | README.rst | 9 | ||||
-rw-r--r-- | __init__.py | 4 | ||||
-rw-r--r-- | _doc/_static/pypi.svg | 2 | ||||
-rw-r--r-- | _test/test_issues.py | 16 | ||||
-rw-r--r-- | scanner.py | 4 |
6 files changed, 35 insertions, 5 deletions
@@ -1,3 +1,8 @@ +[0, 15, 94]: 2019-04-23 + - fix missing line-break after end-of-file comments not ending in + line-break (reported by `Philip Thompson + <https://bitbucket.org/%7Be42ba205-0876-4151-bcbe-ccaea5bd13ce%7D/>`__) + [0, 15, 93]: 2019-04-21 - fix failure to parse empty implicit flow mapping key - in YAML 1.1 plains scalars `y`, 'n', `Y`, and 'N' are now @@ -4,8 +4,8 @@ ruamel.yaml ``ruamel.yaml`` is a YAML 1.2 loader/dumper package for Python. -:version: 0.15.93 -:updated: 2019-04-21 +:version: 0.15.94 +:updated: 2019-04-23 :documentation: http://yaml.readthedocs.io :repository: https://bitbucket.org/ruamel/ :pypi: https://pypi.org/project/ruamel.yaml/ @@ -54,6 +54,11 @@ ChangeLog .. should insert NEXT: at the beginning of line for next key (with empty line) +0.15.94 (2019-04-23): + - fix missing line-break after end-of-file comments not ending in + line-break (reported by `Philip Thompson + <https://bitbucket.org/%7Be42ba205-0876-4151-bcbe-ccaea5bd13ce%7D/>`__) + 0.15.93 (2019-04-21): - fix failure to parse empty implicit flow mapping key - in YAML 1.1 plains scalars `y`, 'n', `Y`, and 'N' are now diff --git a/__init__.py b/__init__.py index 6874999..c7aa6c8 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, 93), - __version__='0.15.93', + version_info=(0, 15, 94), + __version__='0.15.94', 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 e0ca818..10d8154 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.93</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.15.93</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.94</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.15.94</text></g> </svg> diff --git a/_test/test_issues.py b/_test/test_issues.py index 6392ebd..dd534ca 100644 --- a/_test/test_issues.py +++ b/_test/test_issues.py @@ -648,6 +648,22 @@ class TestIssues: assert not a[1] assert not a[3] + def test_issue_286(self): + from ruamel.yaml import YAML + from ruamel.yaml.compat import StringIO + + yaml = YAML() + inp = dedent("""\ + parent_key: + - sub_key: sub_value + + # xxx""") + a = yaml.load(inp) + a['new_key'] = 'new_value' + buf = StringIO() + yaml.dump(a, buf) + assert buf.getvalue().endswith('xxx\nnew_key: new_value\n') + # @pytest.mark.xfail(strict=True, reason='bla bla', raises=AssertionError) # def test_issue_ xxx(self): # inp = """ @@ -1877,6 +1877,10 @@ class RoundTripScanner(Scanner): while ch not in _THE_END: ch = srp() if ch == '\0': # don't gobble the end-of-stream character + # but add an explicit newline as "YAML processors should terminate + # the stream with an explicit line break + # https://yaml.org/spec/1.2/spec.html#id2780069 + comment += '\n' break comment += ch srf() |