Hans Georg Schaathun | 18 Mar 2012 18:50

The autocommit bug with psycopg2

Hi,

sorry if this is an old topic, but I did not find any list
archive.  I just took up using SQLObject a few weeks ago;
very convenient.

I wonder if anyone has experience with a bug where the
the postgress connection attempts to call a boolean
value (autocommit) as a method.  (Call stack is cut in below.)
It is not a new problem, I found it reported here as well:
http://stackoverflow.com/questions/6374121/python-why-does-sqlobject-fail-in-conn-autocommit1

What is odd is that my code works fine on Ubuntu 10.4 with a connection
to localhost.  When I run the same code on Ubuntu 10.10 with a remote
server, it fails.  I am not sure if the difference is with the
remoteness or the software version ... So far I have tried to make do
 with the standard ubuntu packages for sqlobject and postgres.

Does anyone know if this problem has been resolved in some recent 
version of sqlobject/psycopg?  Or if there is a known workaround?
I do observe that the URL below suggests what looks like a 
downgrading of psycopg2, which I won't do if upgrading is an option :-)

My call stack is:
  File "/home/georg/git/pysteg/src/pysteg/sql/tables.py", line 346, in
getJob
    trans = conn.transaction()
  File "/usr/lib/pymodules/python2.7/sqlobject/dbconnection.py", line
400, in transaction
    return Transaction(self)
(Continue reading)

Oleg Broytman | 18 Mar 2012 19:10
X-Face
Favicon
Gravatar

Re: The autocommit bug with psycopg2

On Sun, Mar 18, 2012 at 06:50:07PM +0100, Hans Georg Schaathun wrote:
> sorry if this is an old topic, but I did not find any list
> archive.

   Archives are listed at http://sqlobject.org/community.html

> I just took up using SQLObject a few weeks ago;
> very convenient.
> 
>   File
> "/usr/lib/pymodules/python2.7/sqlobject/postgres/pgconnection.py", line
> 133, in makeConnection
>     conn.autocommit(1)
> TypeError: 'bool' object is not callable

   The bug has been fixed in SQLObject 1.2. Consider upgrading to a
later version.

Oleg.
--

-- 
     Oleg Broytman            http://phdru.name/            phd <at> phdru.name
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
Hans Georg Schaathun | 18 Mar 2012 20:00

Re: The autocommit bug with psycopg2

>    Archives are listed at http://sqlobject.org/community.html

Indeed.  Sorry.  I misread that sentence and thought it referred
to a different list.  Silly me.

>    The bug has been fixed in SQLObject 1.2. Consider upgrading to a
> later version.

Brilliant.  Thank you very much.
It is either that, or just pray patiently that
Ubuntu will upgrade it in the next release next month :-)

:-- George

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure

Gmane