Skip to content

Commit

Permalink
Fix handling of XML values for inf and nan
Browse files Browse the repository at this point in the history
Issue #51
  • Loading branch information
HenrikOssipoff authored and DevDapo committed Nov 3, 2016
1 parent 99825f6 commit d564344
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Change Log
----------

1.2.1 (2016-11-02)
++++++++++++++++++

**Bugfix**

- Fixed a bug where parsing the values "nan", "inf" or "-inf" would lead to a float value, when handling XML values. While this could potentially be correct, it's safer to assume that these values are in fact string values

1.2.0 (2016-04-19)
++++++++++++++++++

Expand Down
2 changes: 2 additions & 0 deletions altapay/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def handle_xml_value(value):
return False
elif value.isdigit():
return int(value)
elif value.lower() in ('nan', 'inf', '-inf'):
return value

try:
return float(value)
Expand Down

0 comments on commit d564344

Please sign in to comment.