Re: Python 2.7 deprecated the PyCObject API?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: James William Pye <lists(at)jwp(dot)name>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Python 2.7 deprecated the PyCObject API?
Date: 2010-08-15 18:25:03
Message-ID: 2536.1281896703@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

James William Pye <lists(at)jwp(dot)name> writes:
> On Aug 14, 2010, at 9:08 AM, Tom Lane wrote:
>> Just to clarify, you're recommending something like
>>
>> proc->me = PyCObject_FromVoidPtr(proc, NULL);
>> + if (proc->me == NULL)
>> + elog(ERROR, "could not create PyCObject for function");
>> PyDict_SetItemString(PLy_procedure_cache, key, proc->me);
>>
>> correct? (Hm, and it looks like we'd better move the pfree just above that...)

> Almost, there's still a Python exception to report and/or clear.

Ah, right, I guess that should be PLy_elog() not just elog().

>> Yeah, and since we'll have to back-patch it, a fairly noninvasive patch
>> would be nice. Will you work on that?

> I was hoping that Peter would pop in with a patch, but I think a few lines of CPP may suffice..
> ...
> yay? nay?

Damifino, I don't hack Python. Peter?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Charles Pritchard 2010-08-15 18:31:30 Re: JSON Patch for PostgreSQL - BSON Support?
Previous Message Dean Rasheed 2010-08-15 17:38:19 WIP: Triggers on VIEWs