Re: Python 2.7 deprecated the PyCObject API?

Поиск
Список
Период
Сортировка
От James William Pye
Тема Re: Python 2.7 deprecated the PyCObject API?
Дата
Msg-id 4A8655F9-54BC-44C0-BC90-575B1E536104@jwp.name
обсуждение исходный текст
Ответ на Python 2.7 deprecated the PyCObject API?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Python 2.7 deprecated the PyCObject API?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Aug 13, 2010, at 5:20 PM, Tom Lane wrote:
> According to a discussion over in Fedora-land, $subject is true:
> http://lists.fedoraproject.org/pipermail/devel/2010-August/140995.html
>
> I see several calls in plpython.c that seem to refer to PyCObject stuff.
> Anybody have any idea if we need to do something about this?


Well, we should at least be checking for an exception here anyways:
       proc->me = PyCObject_FromVoidPtr(proc, NULL);       PyDict_SetItemString(PLy_procedure_cache, key, proc->me);

if (proc->me == NULL) complain();

That is, with those warnings adjustments, proc->me will be NULL and then explode in PyDict_SetItemString:

[David Malcolm]
However, if someone overrides the process-wide warnings settings, then
the API can fail altogether, raising a PendingDeprecationWarning
exception (which in CPython terms means setting a thread-specific error
state and returning NULL).
./


AFA a better fix is concerned, the shortest route would seem to be to use the new capsule stuff iff Python >= 2.7.

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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Re: [COMMITTERS] pgsql: Recognize functional dependency on primary keys.
Следующее
От: Itagaki Takahiro
Дата:
Сообщение: Re: [BUGS] BUG #5608: array_agg() consumes too much memory