[PyGreSQL/f15] Add upstream patch for set_decimal bug

Tom Lane tgl at fedoraproject.org
Fri Jul 8 00:30:29 UTC 2011


commit 6984c944cebd0b1bdb39e01f0f097cf4724218b0
Author: Tom Lane <tgl at redhat.com>
Date:   Thu Jul 7 20:22:26 2011 -0400

    Add upstream patch for set_decimal bug

 PyGreSQL-set-decimal.patch |   23 +++++++++++++++++++++++
 PyGreSQL.spec              |   10 +++++++++-
 2 files changed, 32 insertions(+), 1 deletions(-)
---
diff --git a/PyGreSQL-set-decimal.patch b/PyGreSQL-set-decimal.patch
new file mode 100644
index 0000000..7a27316
--- /dev/null
+++ b/PyGreSQL-set-decimal.patch
@@ -0,0 +1,23 @@
+Upstream's fix for failure of set_decimal method (bug #719093).
+
+
+diff -Naur PyGreSQL-4.0.orig/pgdb.py PyGreSQL-4.0/pgdb.py
+--- PyGreSQL-4.0.orig/pgdb.py	2009-01-01 08:05:02.000000000 -0500
++++ PyGreSQL-4.0/pgdb.py	2011-07-07 20:00:48.297013075 -0400
+@@ -95,13 +95,13 @@
+     """Get or set global type to be used for decimal values."""
+     global Decimal
+     if decimal_type is not None:
+-        Decimal = decimal_type
+-        set_decimal(decimal_type)
++        _cast['numeric'] = Decimal = decimal_type
++        set_decimal(Decimal)
+     return Decimal
+ 
+ 
+ def _cast_bool(value):
+-    return value[:1] in ['t', 'T']
++    return value[:1] in ('t', 'T')
+ 
+ 
+ def _cast_money(value):
diff --git a/PyGreSQL.spec b/PyGreSQL.spec
index a6721a5..b328980 100644
--- a/PyGreSQL.spec
+++ b/PyGreSQL.spec
@@ -1,6 +1,6 @@
 Name:		PyGreSQL
 Version:	4.0
-Release:	2%{?dist}
+Release:	3%{?dist}
 Summary:	A Python client library for PostgreSQL
 
 Group:		Applications/Databases
@@ -14,6 +14,8 @@ License:	PostgreSQL or Python
 
 Source0:	ftp://ftp.pygresql.org/pub/distrib/PyGreSQL-%{version}.tgz
 
+Patch1:		PyGreSQL-set-decimal.patch
+
 # PyGreSQL was originally shipped as a sub-RPM of the PostgreSQL package;
 # these Provides/Obsoletes give a migration path.  Note there is no
 # intention of changing the version numbers in future.
@@ -34,6 +36,8 @@ Python code for accessing a PostgreSQL database.
 %prep
 %setup -q 
 
+%patch1 -p1
+
 # Some versions of PyGreSQL.tgz contain wrong file permissions
 chmod 755 tutorial
 chmod 644 tutorial/*.py
@@ -61,6 +65,10 @@ rm -rf $RPM_BUILD_ROOT
 %{python_sitearch}/*.egg-info
 
 %changelog
+* Thu Jul  7 2011 Tom Lane <tgl at redhat.com> 4.0-3
+- Add upstream patch for set_decimal bug
+Resolves: #719093
+
 * Mon Feb 07 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 4.0-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 


More information about the scm-commits mailing list