pgsql: Improved printing of Python exceptions in PL/Python Mimic the

From: petere(at)postgresql(dot)org (Peter Eisentraut)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improved printing of Python exceptions in PL/Python Mimic the
Date: 2010-01-16 11:03:51
Message-ID: 20100116110351.AF02A7541B9@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Improved printing of Python exceptions in PL/Python

Mimic the Python interpreter's own logic for printing exceptions instead
of just using the straight str() call, so that
you get

plpy.SPIError

instead of

<class 'plpy.SPIError'>

and for built-in exceptions merely

UnicodeEncodeError

Besides looking better this cuts down on the endless version differences
in the regression test expected files.

Modified Files:
--------------
pgsql/src/pl/plpython:
plpython.c (r1.134 -> r1.135)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpython/plpython.c?r1=1.134&r2=1.135)
pgsql/src/pl/plpython/expected:
README (r1.5 -> r1.6)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpython/expected/README?r1=1.5&r2=1.6)
plpython_error.out (r1.8 -> r1.9)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpython/expected/plpython_error.out?r1=1.8&r2=1.9)
plpython_unicode_2.out (r1.4 -> r1.5)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpython/expected/plpython_unicode_2.out?r1=1.4&r2=1.5)
plpython_unicode_3.out (r1.4 -> r1.5)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpython/expected/plpython_unicode_3.out?r1=1.4&r2=1.5)

Removed Files:
-------------
pgsql/src/pl/plpython/expected:
plpython_error_2.out
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpython/expected/plpython_error_2.out)
plpython_unicode_5.out
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpython/expected/plpython_unicode_5.out)

Browse pgsql-committers by date

  From Date Subject
Next Message Magnus Hagander 2010-01-16 11:55:38 pgsql: Build the walreceiver library on MSVC as well.
Previous Message Simon Riggs 2010-01-16 10:13:04 pgsql: Message mentions msec when it should be seconds, so use s instead