[Python-modules-team] Bug#633843: python-sqlobject: autocommit issue with psycopg2
Francisco José Rodríguez Bogado
pacoqueen at gmail.com
Thu Jul 14 09:57:53 UTC 2011
Package: python-sqlobject
Version: 0.12.4-2
Severity: grave
Tags: patch
Justification: renders package unusable
Recently psycopg2 has added a new attribute "autocommit" (bool).
SQLObject checks for a function called autocommit too.
In case of activation of autocommit in your code, SQLObject raises an exception
trying to run autocommit function.
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=es_ES.UTF-8, LC_CTYPE=es_ES.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages python-sqlobject depends on:
ii python 2.6.7-1 interactive high-level object-orie
ii python-formencode 1.2.4-2 validation and form generation Pyt
ii python-pkg-resources 0.6.16-1 Package Discovery and Resource Acc
ii python-support 1.0.14 automated rebuilding support for P
python-sqlobject recommends no packages.
Versions of packages python-sqlobject suggests:
pn python-kinterbasdb <none> (no description available)
pn python-maxdb <none> (no description available)
ii python-mysqldb 1.2.2-10+b3 A Python interface to MySQL
ii python-psycopg2 2.4.2-1 Python module for PostgreSQL
pn python-sqlite <none> (no description available)
-- no debconf information
-------------- next part --------------
--- pgconnection.py.bak 2011-07-14 11:36:38.551584096 +0200
+++ pgconnection.py 2011-07-14 11:40:18.327099899 +0200
@@ -117,7 +117,10 @@
def _setAutoCommit(self, conn, auto):
# psycopg2 does not have an autocommit method.
if hasattr(conn, 'autocommit'):
- conn.autocommit(auto)
+ try:
+ conn.autocommit(auto)
+ except TypeError:
+ conn.autocommit = auto
def makeConnection(self):
try:
@@ -130,7 +133,10 @@
if self.autoCommit:
# psycopg2 does not have an autocommit method.
if hasattr(conn, 'autocommit'):
- conn.autocommit(1)
+ try:
+ conn.autocommit(1)
+ except TypeError:
+ conn.autocommit = 1
c = conn.cursor()
if self.schema:
c.execute("SET search_path TO " + self.schema)
More information about the Python-modules-team
mailing list