diff options
-rw-r--r-- | CHANGES | 5 | ||||
-rw-r--r-- | README.rst | 7 | ||||
-rw-r--r-- | __init__.py | 4 | ||||
-rw-r--r-- | _doc/_static/pypi.svg | 2 | ||||
-rw-r--r-- | representer.py | 4 |
5 files changed, 17 insertions, 5 deletions
@@ -1,3 +1,8 @@ +[0, 17, 4]: 2021-04-07 + - prevent (empty) comments from throwing assertion error (issue 351 + reported by `William Kimball <https://sourceforge.net/u/william303/>`__) + comments (or empty line) will be dropped + [0, 17, 3]: 2021-04-07 - fix for issue 382 caused by an error in a format string (reported by `William Kimball <https://sourceforge.net/u/william303/>`__) @@ -4,7 +4,7 @@ ruamel.yaml ``ruamel.yaml`` is a YAML 1.2 loader/dumper package for Python. -:version: 0.17.3 +:version: 0.17.4 :updated: 2021-04-07 :documentation: http://yaml.readthedocs.io :repository: https://sourceforge.net/projects/ruamel-yaml/ @@ -65,6 +65,11 @@ ChangeLog .. should insert NEXT: at the beginning of line for next key (with empty line) +0.17.4 (2021-04-07): + - prevent (empty) comments from throwing assertion error (issue 351 + reported by `William Kimball <https://sourceforge.net/u/william303/>`__) + comments (or empty line) will be dropped + 0.17.3 (2021-04-07): - fix for issue 382 caused by an error in a format string (reported by `William Kimball <https://sourceforge.net/u/william303/>`__) diff --git a/__init__.py b/__init__.py index 1c22d65..ee2b544 100644 --- a/__init__.py +++ b/__init__.py @@ -5,8 +5,8 @@ if False: # MYPY _package_data = dict( full_package_name='ruamel.yaml', - version_info=(0, 17, 3), - __version__='0.17.3', + version_info=(0, 17, 4), + __version__='0.17.4', 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 07a1442..d88372e 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.17.3</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.17.3</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.17.4</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.17.4</text></g> </svg> diff --git a/representer.py b/representer.py index d82cc3e..32e6f58 100644 --- a/representer.py +++ b/representer.py @@ -863,7 +863,9 @@ class RoundTripRepresenter(SafeRepresenter): node_value = self.represent_data(item_value) item_comment = item_comments.get(item_key) if item_comment: - assert getattr(node_key, 'comment', None) is None + # assert getattr(node_key, 'comment', None) is None + # issue 351 did throw this because the comment from the list item was + # moved to the dict node_key.comment = item_comment[:2] nvc = getattr(node_value, 'comment', None) if nvc is not None: # end comment already there |