From: Oliver Elphick <olly@lfix.co.uk>
To: pgsql-interfaces@postgresql.org
Subject: [Fwd: Bug#143159: python-pygresql: pygresql raises the wrong exception type]
Date: 16 Apr 2002 21:35:26 +0100
Message-ID: <1018989327.32076.23.camel@linda> (raw)
Debian bug report on 7.2.1 PygreSQL. Could any Python guru comment,
please?
-----Forwarded Message-----
From: dman <dman@dman.ddts.net>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Bug#143159: python-pygresql: pygresql raises the wrong exception type
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
try :
conn = pgdb.connect( host="localhost" )
except pgdb.Error :
print "Correct"
except :
print "Wrong!"
print type( sys.exc_info()[0] )
sys.stdout.write( sys.exc_info()[1] )
~~~~
~~~~
Wrong!
<type 'string'>
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=en_US.UTF-8, LC_CTYPE=en_US.UTF-8
Versions of packages python-pygresql depends on:
ii libc6 2.2.5-4 GNU C Library: Shared libraries 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 routines fo
--
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
righteousness; and all these things shall be added
unto you." Matthew 6:33
Attachments:
signature.asc (application/pgp-signature, 231B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: olly@lfix.co.uk
Subject: Re: [Fwd: Bug#143159: python-pygresql: pygresql raises the wrong exception type]
In-Reply-To: <1018989327.32076.23.camel@linda>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox