summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2017-08-09 20:03:45 +0200
committerAnthon van der Neut <anthon@mnt.org>2017-08-09 20:03:45 +0200
commitea69043409ed4cd7fdf89044756e5af1791f2f64 (patch)
tree5983d90c5ffc298f50096c748ee65bbed12462ec
parentfabf65a9f1227448d08e6579ac1e8268762ee9d6 (diff)
downloadruamel.yaml-ea69043409ed4cd7fdf89044756e5af1791f2f64.tar.gz
fix issue #147: not able to dump floats0.15.25
This happened when dumping without loading, e.g.: python -c "import ruamel.yaml, sys; ruamel.yaml.round_trip_dump([3.14])" When this fix solves the problem, please close this issue
-rw-r--r--CHANGES13
-rw-r--r--README.rst3
-rw-r--r--__init__.py4
-rw-r--r--representer.py2
4 files changed, 8 insertions, 14 deletions
diff --git a/CHANGES b/CHANGES
index 0526742..ba3a3a4 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,14 +1,5 @@
-[0, 15, 24]: 2017-08-09
- - added ScalarFloat which supports roundtripping of 23.1, 23.100,
- 42.00E+56, 0.0, -0.0 etc. while keeping the format. Underscores in mantissas
- are not preserved/supported (yet, is anybody using that?).
- - (finally) fixed longstanding issue 23 (reported by `Antony Sottile
- <https://bitbucket.org/asottile/>`_), now handling comment between block
- mapping key and value correctly
- - warn on YAML 1.1 float input that is incorrect (triggered by invalid YAML
- provided by Cecil Curry)
- - allow setting of boolean representation (`false`, `true`) by using:
- ``yaml.boolean_representation = [u'False', u'True']``
+[0, 15, 25]: 2017-08-09
+ - fix for problem with dumping (unloaded) floats (reported by eyenseo)
[0, 15, 24]: 2017-08-09
- added ScalarFloat which supports roundtripping of 23.1, 23.100,
diff --git a/README.rst b/README.rst
index bd61915..17e0b26 100644
--- a/README.rst
+++ b/README.rst
@@ -35,6 +35,9 @@ ChangeLog
.. should insert NEXT: at the beginning of line for next key
+0.15.25 (2017-08-09):
+ - fix for problem with dumping (unloaded) floats (reported by eyenseo)
+
0.15.24 (2017-08-09):
- added ScalarFloat which supports roundtripping of 23.1, 23.100,
42.00E+56, 0.0, -0.0 etc. while keeping the format. Underscores in mantissas
diff --git a/__init__.py b/__init__.py
index 7e45afe..a902392 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, 24),
- __version__='0.15.24',
+ version_info=(0, 15, 25),
+ __version__='0.15.25',
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/representer.py b/representer.py
index cd4ae49..03dcbf4 100644
--- a/representer.py
+++ b/representer.py
@@ -309,7 +309,7 @@ class SafeRepresenter(BaseRepresenter):
value = u'-.inf'
else:
value = to_unicode(repr(data)).lower()
- if self.dumper.version == (1, 1): # type: ignore
+ if self.serializer.use_version == (1, 1): # type: ignore
if u'.' not in value and u'e' in value:
# Note that in some cases `repr(data)` represents a float number
# without the decimal parts. For instance: