[Python-modules-commits] r4470 - in packages/python-django/branches/0.96/debian (2 files)
brettp-guest at users.alioth.debian.org
brettp-guest at users.alioth.debian.org
Tue Feb 5 21:17:02 UTC 2008
Date: Tuesday, February 5, 2008 @ 21:17:01
Author: brettp-guest
Revision: 4470
Fix for postgres backend when version string isn't simply \d+\.\d+\.\d+ (#462058)
Added:
packages/python-django/branches/0.96/debian/patches/03_pg_version_fix.diff
Modified:
packages/python-django/branches/0.96/debian/changelog
Modified: packages/python-django/branches/0.96/debian/changelog
===================================================================
--- packages/python-django/branches/0.96/debian/changelog 2008-02-05 17:43:50 UTC (rev 4469)
+++ packages/python-django/branches/0.96/debian/changelog 2008-02-05 21:17:01 UTC (rev 4470)
@@ -1,3 +1,10 @@
+python-django (0.96.1-2) unstable; urgency=low
+
+ * Fix for postgres backend for version numbers that aren't purely numeric
+ Closes: #462058
+
+ -- Brett Parker <iDunno at sommitrealweird.co.uk> Wed, 23 Jan 2008 22:14:34 +0000
+
python-django (0.96.1-1) unstable; urgency=low
* New upstream release with security fix for CVE-2007-5712
Added: packages/python-django/branches/0.96/debian/patches/03_pg_version_fix.diff
===================================================================
--- packages/python-django/branches/0.96/debian/patches/03_pg_version_fix.diff (rev 0)
+++ packages/python-django/branches/0.96/debian/patches/03_pg_version_fix.diff 2008-02-05 21:17:01 UTC (rev 4470)
@@ -0,0 +1,25 @@
+--- django/db/backends/postgresql/base.py.orig
++++ django/db/backends/postgresql/base.py
+@@ -86,7 +86,21 @@ class DatabaseWrapper(local):
+ global postgres_version
+ if not postgres_version:
+ cursor.execute("SELECT version()")
+- postgres_version = [int(val) for val in cursor.fetchone()[0].split()[1].split('.')]
++ version_parts = cursor.fetchone()[0].split()[1].split('.')
++ postgres_version = []
++ for part in version_parts:
++ if part.isdigit():
++ postgres_version.append(int(part))
++ else:
++ digit = ""
++ for c in part:
++ if c.isdigit():
++ digit += c
++ else:
++ break
++ if digit != "":
++ postgres_version.append(int(digit))
++ break
+ if settings.DEBUG:
+ return util.CursorDebugWrapper(cursor, self)
+ return cursor
More information about the Python-modules-commits
mailing list