[Python-Dev] pymalloc API - is 1.5.2 compatibility a possible explanation?
Michael Hudson
mwh@python.net
19 Mar 2002 09:28:35 +0000
Skip Montanaro <skip@pobox.com> writes:
> 1.5.2 rears its ugly head again...
>
> Neil S. reported on a number of 3rd party extension modules that don't do
> object alloc/free properly. I reported a bug to the mysql-python project,
> which uses PyObject_NEW and PyMem_Free. Andy Dustman's reply, in part, was:
>
> 1.5.2 apparently does not have PyObject_New() or PyObject_Del(), thus
> the problem...
>
> The thread is here:
>
> http://sourceforge.net/tracker/?func=detail&atid=374932&aid=531671&group_id=22307
>
> Check here for Andy's proposed patch to _mysql.c (ignore the non-alloc
> stuff):
>
> http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mysql-python/MySQLdb/_mysql.c.diff?r1=1.16&r2=1.22
Better IMHO is what _sre.c does:
#if PY_VERSION_HEX < 0x01060000
#define PyObject_DEL(op) PyMem_DEL((op))
#endif
... except that should probably be _Del & there should probably be an
equivalent one for PyObject_New.
> It would appear at least some of the breakage stems from actual or perceived
> differences in the object allocation API between 1.5.2 and 2.x.
I thought we'd already worked this much out...
Cheers,
M.
--
... but I'd rather not reinvent the wheel if I don't have to. On
the other hand, if the currently instantiated version of the wheel
consists of a square rock covered with moss, I might as well just
start fresh. -- Roy Smith, comp.lang.python