summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES8
-rw-r--r--README.rst6
-rw-r--r--__init__.py4
-rw-r--r--_doc/_static/pypi.svg2
-rw-r--r--_test/test_issues.py6
-rw-r--r--constructor.py5
6 files changed, 23 insertions, 8 deletions
diff --git a/CHANGES b/CHANGES
index dc61c35..101b7ef 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,11 @@
+[0, 15, 59]: 2018-08-17
+ - issue with C based loader and leading zeros (reported by
+ `Tom Hamilton Stubber <https://bitbucket.org/TomHamiltonStubber/>`__)
+
+[0, 15, 59]: 2018-08-17
+ - issue with C based loader and leading zeros (reported by
+ `Tom Hamilton Stubber <https://bitbucket.org/TomHamiltonStubber/>`__)
+
[0, 15, 58]: 2018-08-17
- simple mappings can now be used as keys when round-tripping::
diff --git a/README.rst b/README.rst
index 6fc5eff..4a7cf00 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.58
+:version: 0.15.59
:updated: 2018-08-17
: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.59 (2018-08-17):
+ - issue with C based loader and leading zeros (reported by
+ `Tom Hamilton Stubber <https://bitbucket.org/TomHamiltonStubber/>`__)
+
0.15.58 (2018-08-17):
- simple mappings can now be used as keys when round-tripping::
diff --git a/__init__.py b/__init__.py
index c2c86f4..c513dec 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, 58),
- __version__='0.15.58',
+ version_info=(0, 15, 59),
+ __version__='0.15.59',
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 d1b22aa..fbf4350 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.58</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.15.58</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.59</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.15.59</text></g> </svg>
diff --git a/_test/test_issues.py b/_test/test_issues.py
index bd47155..cbec708 100644
--- a/_test/test_issues.py
+++ b/_test/test_issues.py
@@ -287,8 +287,10 @@ class TestIssues:
ruamel.yaml.safe_dump(['012923'], buf)
assert buf.getvalue() == "['012923']\n"
- @pytest.mark.xfail(strict=True)
def test_issue_223(self):
import ruamel.yaml
+
yaml = ruamel.yaml.YAML(typ='safe')
- yaml.load("phone: 0123456789")
+ yaml.load('phone: 0123456789')
+
+ # @pytest.mark.xfail(strict=True)
diff --git a/constructor.py b/constructor.py
index 9408c3c..dddf8bc 100644
--- a/constructor.py
+++ b/constructor.py
@@ -418,6 +418,7 @@ class SafeConstructor(BaseConstructor):
def construct_yaml_int(self, node):
# type: (Any) -> int
+ print('ver', self.resolver.processing_version)
value_s = to_str(self.construct_scalar(node))
value_s = value_s.replace('_', "")
sign = +1
@@ -433,9 +434,9 @@ class SafeConstructor(BaseConstructor):
return sign * int(value_s[2:], 16)
elif value_s.startswith('0o'):
return sign * int(value_s[2:], 8)
- elif self.resolver.processing_version != (1, 2) and value_s[0] == '0':
+ elif self.resolver.processing_version == (1, 1) and value_s[0] == '0':
return sign * int(value_s, 8)
- elif self.resolver.processing_version != (1, 2) and ':' in value_s:
+ elif self.resolver.processing_version == (1, 1) and ':' in value_s:
digits = [int(part) for part in value_s.split(':')]
digits.reverse()
base = 1