From: SourceForge.net <no...@so...> - 2005-06-20 16:23:35
|
Bugs item #1224272, was opened at 2005-06-21 02:23 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116528&aid=1224272&group_id=16528 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Ben Burton (bab) Assigned to: Nobody/Anonymous (nobody) Summary: Parsing of float values is not locale agnostic Initial Comment: Hi, A report was submitted to the Debian BTS describing a serious bug in pypgsql that can lead to incorrect numerical results in financial applications and the like. The basic problem is that pypgsql uses strtod() for parsing floats, which interprets strings according to the current locale. As a result, if you parse a decimal value (e.g., "1.5") in a locale that uses a comma as a decimal separator (such as de_DE), you get an incorrect value (in this case, 1). Martin Pitt has patched this problem (and I have also applied this patch to the debian packages). I have included the patch as an attachment to this bug. The patch is simple; replace strtod() with PyOS_ascii_strtod(). Since PyOS_ascii_strtod() is only available in python 2.4 and newer, the patch also includes an implementation of this function for use with earlier python versions. For more information on this report, please see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=311328 . Ben. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116528&aid=1224272&group_id=16528 |