Received: from candle.pha.pa.us (216-55-132-35.dsl.san-diego.abac.net [216.55.132.35]) by postgresql.org (Postfix) with ESMTP id 61AAB475484 for ; Thu, 4 Apr 2002 01:44:44 -0500 (EST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id g346iVd08732; Thu, 4 Apr 2002 01:44:31 -0500 (EST) From: Bruce Momjian Message-Id: <200204040644.g346iVd08732@candle.pha.pa.us> Subject: Re: PyGreSQL bug In-Reply-To: <20020327230927.A18128@lynn.ci-n.com> To: Andrew Johnson Date: Thu, 4 Apr 2002 01:44:31 -0500 (EST) Cc: PostgreSQL-interfaces X-Mailer: ELM [version 2.4ME+ PL97 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200204/3 X-Sequence-Number: 2545 Can someone comment on this? --------------------------------------------------------------------------- Andrew Johnson wrote: > Not sure if you're the right person to be talking to here, but the recent > CVS pacthes to the module belong to you, so here goes. > > pgdb.connect() seems to be broken on Python 2.0.1 (which ships with > Slackware 8), and perhaps on other Pythons, haven't checked. Something in > the _pg.connect() call isn't working. I think the problem stems from the > fact that 'host' is a named parameter of both _pg.connect and pgdb.connect, > and so Python treats it as a variable assignment, not a named parameter. > > In any case, rewriting the call without named parameters solved the problem. > > Instead of: > > cnx = _pg.connect(host = dbhost, dbname = dbbase, port = dbport, > opt = dbopt, tty = dbtty, > user = dbuser, passwd = dbpassw > > use: > > cnx = _pg.connect(dbbase, dbhost, dbport, dbopt, > dbtty, dbuser, dbpasswd) > > -- > Andrew Johnson (ajohnson@lynn.ci-n.com) > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026