Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#99 connection to 8.3beta3 fails on version info

open
nobody
5
2007-12-10
2007-12-10
Matthew Grosso
No

>>> c=pyPgSQL.PgSQL.connect(user='mgrosso')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/site-packages/pyPgSQL/PgSQL.py", line 2211, in connect
return Connection(connInfo, client_encoding, unicode_results)
File "/usr/lib/python2.4/site-packages/pyPgSQL/PgSQL.py", line 2331, in __init__
raise DatabaseError, m
libpq.DatabaseError: Ivalid format for PgVersion construction.
>>> c

its fixed by this change

$ diff -u pyPgSQL-2.5.1 pyPgSQL-2.5.1-betafix
Only in pyPgSQL-2.5.1-betafix: build
Common subdirectories: pyPgSQL-2.5.1/examples and pyPgSQL-2.5.1-betafix/examples
diff -u pyPgSQL-2.5.1/pgversion.c pyPgSQL-2.5.1-betafix/pgversion.c
--- pyPgSQL-2.5.1/pgversion.c 2006-06-02 07:27:45.000000000 -0700
+++ pyPgSQL-2.5.1-betafix/pgversion.c 2007-12-09 20:22:32.000000000 -0800
@@ -293,12 +293,12 @@
if (parseToken(token, &major))
goto new_error;

- token = pg_strtok_r((char *)NULL, ".", &save_ptr);
+ token = pg_strtok_r((char *)NULL, ".-beta", &save_ptr);
if ((token != (char *)NULL) && (*token != '\0') &&
(parseToken(token, &minor)))
goto new_error;

- token = pg_strtok_r((char *)NULL, ".-", &save_ptr);
+ token = pg_strtok_r((char *)NULL, ".-beta", &save_ptr);
if ((token != (char *)NULL) && (*token != '\0') &&
(parseToken(token, &patch)))
{
Common subdirectories: pyPgSQL-2.5.1/port and pyPgSQL-2.5.1-betafix/port
Common subdirectories: pyPgSQL-2.5.1/pyPgSQL and pyPgSQL-2.5.1-betafix/pyPgSQL
Common subdirectories: pyPgSQL-2.5.1/test and pyPgSQL-2.5.1-betafix/test
$

Discussion