diff -u python-pgsql-2.4.0/debian/changelog python-pgsql-2.4.0/debian/changelog
--- python-pgsql-2.4.0/debian/changelog
+++ python-pgsql-2.4.0/debian/changelog
@@ -1,3 +1,14 @@
+python-pgsql (2.4.0-5ubuntu3) breezy; urgency=low
+
+  * pgresult.c:
+    - Use PyOS_ascii_strtod() instead of strtod() to use locale agnostic
+      parser.
+    - If compiling with a Python version < 2.4, add a local copy of python
+      2.4's PyOS_ascii_strtod() function.
+    - Ubuntu #10191
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Mon, 30 May 2005 17:10:44 +0200
+
 python-pgsql (2.4.0-5ubuntu2) hoary; urgency=low
 
   * Don't build python2.1, python2.2 packages.
only in patch2:
unchanged:
--- python-pgsql-2.4.0.orig/pgresult.c
+++ python-pgsql-2.4.0/pgresult.c
@@ -110,6 +110,175 @@
 
 /*--------------------------------------------------------------------------*/
 
+#if (PY_VERSION_HEX < 0x02040000)
+
+/* code stolen from Python 2.4 */
+
+#include <locale.h>
+
+#define ISSPACE(c)  ((c) == ' ' || (c) == '\f' || (c) == '\n' || \
+                     (c) == '\r' || (c) == '\t' || (c) == '\v')
+#define ISDIGIT(c)  ((c) >= '0' && (c) <= '9')
+#define ISXDIGIT(c) (ISDIGIT(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
+
+/**
+ * PyOS_ascii_strtod:
+ * @nptr:    the string to convert to a numeric value.
+ * @endptr:  if non-%NULL, it returns the character after
+ *           the last character used in the conversion.
+ * 
+ * Converts a string to a #gdouble value.
+ * This function behaves like the standard strtod() function
+ * does in the C locale. It does this without actually
+ * changing the current locale, since that would not be
+ * thread-safe.
+ *
+ * This function is typically used when reading configuration
+ * files or other non-user input that should be locale independent.
+ * To handle input from the user you should normally use the
+ * locale-sensitive system strtod() function.
+ *
+ * If the correct value would cause overflow, plus or minus %HUGE_VAL
+ * is returned (according to the sign of the value), and %ERANGE is
+ * stored in %errno. If the correct value would cause underflow,
+ * zero is returned and %ERANGE is stored in %errno.
+ * 
+ * This function resets %errno before calling strtod() so that
+ * you can reliably detect overflow and underflow.
+ *
+ * Return value: the #gdouble value.
+ **/
+double
+PyOS_ascii_strtod(const char  *nptr, 
+	    char       **endptr)
+{
+	char *fail_pos;
+	double val;
+	struct lconv *locale_data;
+	const char *decimal_point;
+	int decimal_point_len;
+	const char *p, *decimal_point_pos;
+	const char *end = NULL; /* Silence gcc */
+
+/* 	g_return_val_if_fail (nptr != NULL, 0); */
+	assert(nptr != NULL);
+
+	fail_pos = NULL;
+
+	locale_data = localeconv();
+	decimal_point = locale_data->decimal_point;
+	decimal_point_len = strlen(decimal_point);
+
+	assert(decimal_point_len != 0);
+
+	decimal_point_pos = NULL;
+	if (decimal_point[0] != '.' || 
+	    decimal_point[1] != 0)
+	{
+		p = nptr;
+		  /* Skip leading space */
+		while (ISSPACE(*p))
+			p++;
+
+		  /* Skip leading optional sign */
+		if (*p == '+' || *p == '-')
+			p++;
+
+		if (p[0] == '0' && 
+		    (p[1] == 'x' || p[1] == 'X'))
+		{
+			p += 2;
+			  /* HEX - find the (optional) decimal point */
+
+			while (ISXDIGIT(*p))
+				p++;
+
+			if (*p == '.')
+			{
+				decimal_point_pos = p++;
+
+				while (ISXDIGIT(*p))
+					p++;
+
+				if (*p == 'p' || *p == 'P')
+					p++;
+				if (*p == '+' || *p == '-')
+					p++;
+				while (ISDIGIT(*p))
+					p++;
+				end = p;
+			}
+		}
+		else
+		{
+			while (ISDIGIT(*p))
+				p++;
+
+			if (*p == '.')
+			{
+				decimal_point_pos = p++;
+
+				while (ISDIGIT(*p))
+					p++;
+
+				if (*p == 'e' || *p == 'E')
+					p++;
+				if (*p == '+' || *p == '-')
+					p++;
+				while (ISDIGIT(*p))
+					p++;
+				end = p;
+			}
+		}
+		  /* For the other cases, we need not convert the decimal point */
+	}
+
+	  /* Set errno to zero, so that we can distinguish zero results
+	     and underflows */
+	errno = 0;
+
+	if (decimal_point_pos)
+	{
+		char *copy, *c;
+
+		  /* We need to convert the '.' to the locale specific decimal point */
+		copy = malloc(end - nptr + 1 + decimal_point_len);
+
+		c = copy;
+		memcpy(c, nptr, decimal_point_pos - nptr);
+		c += decimal_point_pos - nptr;
+		memcpy(c, decimal_point, decimal_point_len);
+		c += decimal_point_len;
+		memcpy(c, decimal_point_pos + 1, end - (decimal_point_pos + 1));
+		c += end - (decimal_point_pos + 1);
+		*c = 0;
+
+		val = strtod(copy, &fail_pos);
+
+		if (fail_pos)
+		{
+			if (fail_pos > decimal_point_pos)
+				fail_pos = (char *)nptr + (fail_pos - copy) - (decimal_point_len - 1);
+			else
+				fail_pos = (char *)nptr + (fail_pos - copy);
+		}
+
+		free(copy);
+
+	}
+	else
+		val = strtod(nptr, &fail_pos);
+
+	if (endptr)
+		*endptr = fail_pos;
+
+	return val;
+}
+
+#endif
+
+/*--------------------------------------------------------------------------*/
+
 PyObject *PgResult_New(PGresult *res, PgConnection *conn, int type)
 {
     PgResult *self;
@@ -623,7 +792,7 @@
 		/*FALLTHRU*/
 
 	    case PG_FLOAT8:
-		valueObj = Py_BuildValue("d", strtod(value, NULL));
+		valueObj = Py_BuildValue("d", PyOS_ascii_strtod(value, NULL));
 		break;
 
 	    case PG_BYTEA:

