the attached patch is tested with psycopg 2.0b8 and 1.1.21.

On 12/3/06, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
On Sun, Dec 03, 2006 at 06:00:28PM +0100, Robert Forkel wrote:
> one more datapoint: psycopg 1.99.13 expects a string, too. so at
> least, one could differentiate based on psycopg major versions, i.e.
> psycopg.__version__.split('.')[0] == '1'
> or something like that.

   I see. Please create a patch, I will test and apply it.

Oleg.
--
     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

--- /usr/lib/python2.4/site-packages/SQLObject-0.7.2b1-py2.4.egg/sqlobject/postgres/old_pgconnection.py	2006-12-03 16:51:12.000000000 +0100
+++ /usr/lib/python2.4/site-packages/SQLObject-0.7.2b1-py2.4.egg/sqlobject/postgres/pgconnection.py	2006-12-03 19:23:53.000000000 +0100
@@ -45,7 +45,10 @@
             if usePygresql:
                 dsn_dict["host"] = "%s:%d" % (host, port)
             else:
-                dsn_dict["port"] = port
+                if psycopg.__version__.split('.')[0] == '1':
+                    dsn_dict["port"] = str(port)
+                else:
+                    dsn_dict["port"] = port
         if db:
             dsn_dict["database"] = db
         if user:
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to