diff options
-rw-r--r-- | CHANGES | 6 | ||||
-rw-r--r-- | README.rst | 10 | ||||
-rw-r--r-- | __init__.py | 4 | ||||
-rw-r--r-- | _doc/_static/pypi.svg | 2 | ||||
-rw-r--r-- | _test/test_issues.py | 21 | ||||
-rw-r--r-- | constructor.py | 4 |
6 files changed, 29 insertions, 18 deletions
@@ -1,3 +1,9 @@ +[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/>`__) + - fix issue with loading Python objects that have __setstate__ and recursion in parameters + (reported by `Douglas RAILLARD <https://bitbucket.org/DouglasRaillard/>`__) + [0, 15, 67]: 2018-09-19 - fix issue with extra space inserted with non-root literal strings (Issue reported and PR with fix provided by @@ -4,8 +4,8 @@ ruamel.yaml ``ruamel.yaml`` is a YAML 1.2 loader/dumper package for Python. -:version: 0.15.67 -:updated: 2018-09-19 +:version: 0.15.68 +:updated: 2018-09-20 :documentation: http://yaml.readthedocs.io :repository: https://bitbucket.org/ruamel/ :pypi: https://pypi.org/project/ruamel.yaml/ @@ -54,6 +54,12 @@ ChangeLog .. should insert NEXT: at the beginning of line for next key (with empty line) +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/>`__) + - fix issue with loading Python objects that have __setstate__ and recursion in parameters + (reported by `Douglas RAILLARD <https://bitbucket.org/DouglasRaillard/>`__) + 0.15.67 (2018-09-19): - fix issue with extra space inserted with non-root literal strings (Issue reported and PR with fix provided by diff --git a/__init__.py b/__init__.py index a2ae153..0b9da5c 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, 67), - __version__='0.15.67', + version_info=(0, 15, 68), + __version__='0.15.68', 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 5d93fbb..edb974a 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.67</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.15.67</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.68</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.15.68</text></g> </svg> diff --git a/_test/test_issues.py b/_test/test_issues.py index 3ead121..0612be1 100644 --- a/_test/test_issues.py +++ b/_test/test_issues.py @@ -450,37 +450,36 @@ class TestIssues: """ d = round_trip(inp, preserve_quotes=True) # NOQA - @pytest.mark.xfail(strict=True, reason='resolving __setstate__', raises=AssertionError) def test_issue_238(self, tmpdir): - program_src = r''' + program_src = r""" import ruamel.yaml from ruamel.yaml.compat import StringIO yaml = ruamel.yaml.YAML(typ='unsafe') - - + + class A: def __setstate__(self, d): self.__dict__ = d - + class B: pass - - + + a = A() b = B() - + a.x = b b.y = [b] assert a.x.y[0] == a.x - + buf = StringIO() yaml.dump(a, buf) - + data = yaml.load(buf.getvalue()) assert data.x.y[0] == data.x - ''' + """ assert save_and_run(dedent(program_src), tmpdir) == 0 diff --git a/constructor.py b/constructor.py index 169155c..6448067 100644 --- a/constructor.py +++ b/constructor.py @@ -915,8 +915,8 @@ class Constructor(SafeConstructor): # !!python/object:module.name { ... state ... } instance = self.make_python_instance(suffix, node, newobj=True) yield instance - deep = hasattr(instance, '__setstate__') - state = self.construct_mapping(node, deep=deep) + # deep = hasattr(instance, '__setstate__') + state = self.construct_mapping(node, deep=False) self.set_python_instance_state(instance, state) def construct_python_object_apply(self, suffix, node, newobj=False): |