[DB-SIG] pypg pure Python db driver for Postgresql

Randall Smith randall at tnr.cc
Tue Jul 12 15:38:53 CEST 2005


Well, you found two bugs.  A bug in the protocol (lack of handling) and 
a bug in the error handler.  I uploaded a new version to fix the bug in 
the error handler, but I don't know what message it is that is not being 
handled.

emsg = 'Did not handle response, %s' % nextmsg_format_name

should read

emsg = 'Did not handle response, %s' % nextmsg.format_name

This happens after an authentication attempt if neither an 
'ErrorResponse' or 'AuthenticationOk' message is received.

 From the docs:

The authentication cycle ends with the server either rejecting the 
connection attempt (ErrorResponse), or sending AuthenticationOk.

Maybe I have not supported your authentication scheme yet.  What 
authentication scheme are you using?  For that matter what is your OS, 
Postgresql version etc.

Randall

Stephane Bortzmeyer wrote:
> On Tue, Jul 12, 2005 at 07:56:33AM -0500,
>  Randall Smith <randall at tnr.cc> wrote 
>  a message of 35 lines which said:
> 
> 
>>In its current state (early alpha), pypg does not support Unix
>>sockets or connection strings.
> 
> 
> :-(
> 
> 
>>You may connect like so:
> 
> 
> New error message :-)
> 
> % python test.py
> Traceback (most recent call last):
>   File "test.py", line 115, in ?
>     user='bortzmeyer')
>   File "/usr/local/lib/python2.3/site-packages/pypg/pgdb2.py", line 413, in connect
>     dbtty, dbuser, dbpasswd)
>   File "/usr/local/lib/python2.3/site-packages/pypg/_mypg.py", line 175, in connect
>     return Connection(dbhost, dbport, dbbase, dbuser, dbpasswd)
>   File "/usr/local/lib/python2.3/site-packages/pypg/_mypg.py", line 58, in __init__
>     self.connect()
>   File "/usr/local/lib/python2.3/site-packages/pypg/_mypg.py", line 84, in connect
>     emsg = 'Did not handle response, %s' % nextmsg_format_name
> NameError: global name 'nextmsg_format_name' is not defined


More information about the DB-SIG mailing list