Received: from anchor-post-34.mail.demon.net (anchor-post-34.mail.demon.net [194.217.242.92]) by postgresql.org (Postfix) with ESMTP id 542AF47595E for ; Tue, 16 Apr 2002 16:35:27 -0400 (EDT) Received: from lfix.demon.co.uk ([158.152.59.127] helo=linda.lfix.co.uk) by anchor-post-34.mail.demon.net with esmtp (Exim 3.35 #1) id 16xZfj-00072l-0Y for pgsql-interfaces@postgresql.org; Tue, 16 Apr 2002 21:35:27 +0100 Received: from localhost ([127.0.0.1] helo=localhost.localdomain ident=olly) by linda.lfix.co.uk with esmtp (Exim 3.35 #1 (Debian)) id 16xZfj-0001LA-00 for ; Tue, 16 Apr 2002 21:35:27 +0100 Subject: [Fwd: Bug#143159: python-pygresql: pygresql raises the wrong exception type] From: Oliver Elphick To: pgsql-interfaces@postgresql.org Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-ZC+N9f/WMS8y2ra95mvd" X-Mailer: Ximian Evolution 1.0.3 Date: 16 Apr 2002 21:35:26 +0100 Message-Id: <1018989327.32076.23.camel@linda> Mime-Version: 1.0 X-Archive-Number: 200204/31 X-Sequence-Number: 2573 --=-ZC+N9f/WMS8y2ra95mvd Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Debian bug report on 7.2.1 PygreSQL. Could any Python guru comment, please? -----Forwarded Message----- From: dman To: Debian Bug Tracking System Subject: Bug#143159: python-pygresql: pygresql raises the wrong exception t= ype Date: 16 Apr 2002 11:41:05 -0500 Package: python-pygresql Version: 7.2.1-2 Severity: normal I have just discovered that pygresql raises the wrong exception type in some circumstances. All exceptions are supposed to be a subclass of pgdb.Error. If postmaster is not running on the host, this example shows that pygresql raises an exception whose type is '_pg.error' (a string). ~~~~ #!/usr/bin/python2.1 import sys import pgdb=20 try : conn =3D pgdb.connect( host=3D"localhost" ) except pgdb.Error : print "Correct" except : print "Wrong!" print type( sys.exc_info()[0] ) sys.stdout.write( sys.exc_info()[1] ) ~~~~ ~~~~ Wrong! could not connect to server: Connection refused Is the server running on host localhost and accepting TCP/IP connections on port 5432? ~~~~ -D -- System Information Debian Release: 3.0 Architecture: i386 Kernel: Linux dman 2.4.18-custom.3 #1 Mon Apr 15 09:54:59 CDT 2002 i686 Locale: LANG=3Den_US.UTF-8, LC_CTYPE=3Den_US.UTF-8 Versions of packages python-pygresql depends on: ii libc6 2.2.5-4 GNU C Library: Shared librarie= s an ii libpgsql2 7.2.1-2 Shared library libpq.so.2 for = Post ii python 2.1.2-3 An interactive object-oriented= scr ii python2.1-egenix-mxdatetime 2.0.3-3 Date and time handling routine= s fo --=20 Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C "But seek ye first the kingdom of God, and his=20=20 righteousness; and all these things shall be added=20 unto you." Matthew 6:33=20 --=-ZC+N9f/WMS8y2ra95mvd Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQA8vIsNYU1MND4dDBwRAoxFAJwKsKmCiF1HXZfyHOCQY/xR8U8k/QCgkoNh Jt8mvijjBeS4uNNoXQpL54Y= =RPLE -----END PGP SIGNATURE----- --=-ZC+N9f/WMS8y2ra95mvd--