summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2018-09-20 16:48:10 +0200
committerAnthon van der Neut <anthon@mnt.org>2018-09-20 16:48:10 +0200
commite1594f4f390a67f376722086ea4ac3e5583d003d (patch)
tree7b3e926d8a2e8507538832f0a216c39effc58dfb
parentc706e5ec84f7520b1e63110af89f441ebdbceae6 (diff)
downloadruamel.yaml-e1594f4f390a67f376722086ea4ac3e5583d003d.tar.gz
fix issue #239 dropping comments before document-end on load_all0.15.69
*When this change indeed resolves your problem, please **Close** this issue*. *(You can do so using the WorkFlow pull-down (close to the top right of this page))*
-rw-r--r--CHANGES4
-rw-r--r--README.rst6
-rw-r--r--__init__.py4
-rw-r--r--_doc/_static/pypi.svg2
-rw-r--r--_test/test_issues.py4
-rw-r--r--tokens.py2
6 files changed, 15 insertions, 7 deletions
diff --git a/CHANGES b/CHANGES
index ba7d70a..6b8208e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+[0, 15, 69]: 2018-09-20
+ - fix issue with dump_all gobbling end-of-document comments on parsing
+ (reported by `Pierre B. <https://bitbucket.org/octplane/>`__)
+
[0, 15, 68]: 2018-09-20
- fix issue with parsabel, but incorrect output with nested flow-style sequences
(reported by `Dougal Seeley <https://bitbucket.org/dseeley/>`__)
diff --git a/README.rst b/README.rst
index 36a1487..607fd5e 100644
--- a/README.rst
+++ b/README.rst
@@ -4,7 +4,7 @@ ruamel.yaml
``ruamel.yaml`` is a YAML 1.2 loader/dumper package for Python.
-:version: 0.15.68
+:version: 0.15.69
:updated: 2018-09-20
:documentation: http://yaml.readthedocs.io
:repository: https://bitbucket.org/ruamel/
@@ -54,6 +54,10 @@ ChangeLog
.. should insert NEXT: at the beginning of line for next key (with empty line)
+0.15.69 (2018-09-20):
+ - fix issue with dump_all gobbling end-of-document comments on parsing
+ (reported by `Pierre B. <https://bitbucket.org/octplane/>`__)
+
0.15.68 (2018-09-20):
- fix issue with parsabel, but incorrect output with nested flow-style sequences
(reported by `Dougal Seeley <https://bitbucket.org/dseeley/>`__)
diff --git a/__init__.py b/__init__.py
index 0b9da5c..16bfa0c 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, 68),
- __version__='0.15.68',
+ version_info=(0, 15, 69),
+ __version__='0.15.69',
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 edb974a..c73ced3 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.68</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.15.68</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.69</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.15.69</text></g> </svg>
diff --git a/_test/test_issues.py b/_test/test_issues.py
index 9c06af4..f3a0389 100644
--- a/_test/test_issues.py
+++ b/_test/test_issues.py
@@ -483,8 +483,7 @@ class TestIssues:
"""
assert save_and_run(dedent(program_src), tmpdir) == 0
- @pytest.mark.xfail(strict=True, reason='bla bla', raises=AssertionError)
- def test_issue_xxx(self):
+ def test_issue_239(self):
inp = """
first_name: Art
occupation: Architect
@@ -500,6 +499,7 @@ class TestIssues:
# Lost again
---
I: knew
+ # final words
"""
d = YAML().round_trip_all(inp) # NOQA
diff --git a/tokens.py b/tokens.py
index 4dd0c1d..eb03ae8 100644
--- a/tokens.py
+++ b/tokens.py
@@ -69,7 +69,7 @@ class Token(object):
if c is None:
return
# don't push beyond last element
- if isinstance(target, StreamEndToken):
+ if isinstance(target, (StreamEndToken, DocumentStartToken)):
return
delattr(self, '_comment')
tc = target.comment