exceptions not present in plpy with Python 3

Поиск
Список
Период
Сортировка
От Jan Urbański
Тема exceptions not present in plpy with Python 3
Дата
Msg-id 4D0CF5CD.4040301@wulczer.org
обсуждение исходный текст
Ответы Re: exceptions not present in plpy with Python 3  (Jan Urbański <wulczer@wulczer.org>)
Re: exceptions not present in plpy with Python 3  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Hi,

there seems to be a problem in the way we add exceptions to the plpy
module in PL/Python compiled with Python 3k.

Try this: DO $$ plpy.SPIError $$ language plpython3u;

I'm not a Python 3 expert, but I nicked some code from the Internet and
came up with this patch (passes regression tests on both Python 2 and 3).

The funny thing is that it never blew up earlier, because we only used
plpy.SPIError in except: blocks that weren't even executed, as errors in
plpy.execute just terminate the function.

With my changes they turn into catchable exceptions, and so accessing
plpy.SPIError in Python 3 becomes essential.

BTW: do we have any buildfarm animal that uses Python 3?

Cheers,
Jan

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: Extensions, patch v19 (encoding brainfart fix)
Следующее
От: Bruce Momjian
Дата:
Сообщение: pg_ctl and port number detection