Re: [PATCH] C extension fails to build on Python 2.5 because of PyUnicode_FromFormat

"R. Tyler Ballance" <[email protected]> Sat, 10 Apr 2010 15:05:32 -0700
Newsgroups gmane.comp.python.cheetah
Message-ID <20100410220531.GB3562@kiwi>
On Wed, 31 Mar 2010, Arnaud Fontaine wrote:

> Hi,
> 
>     > Aha, good  catch Arnaud, I had experienced a  similar quirk when I
>     > ported another C-extension that I  maintain to run on Python 2.4 -
>     > 3.1, I'll squeeze an update out tonight or tomorrow :)
> 
> Does the patch look alright? I have already uploaded a Debian package of
> python-cheetah 2.4.2.1  which includes this patch. So  don't worry about
> the update  ;), especially because I seem  to be the only  one to report
> such issue.

Regarding the patch, I think I might rather add somtehing like the following:

    #ifndef PyUnicode_FromFormat
    #define PyUnicode_FromFormat(a, b) PyString_FromFormat(a, b)
    #end def

I define similar macros for supporting Python 2.4/2.5 with another one of my
projects:
    http://github.com/rtyler/py-yajl/blob/master/py_yajl.h#L64

> 
>     >> BTW, my question may be silly but I'm wondering why `newExcValue'
>     >>      reference       returned      by      PyUnicode_FromFormat()
>     >>   (wrapInternalNotFoundException()  function)  is   never  DECREF
>     >>   whereas   it   is   in  setNotFoundException()   function   for
>     >> `exceptionStr'.  Just curious ;)...
> 
> Any thoughts about that? ;)

Probably a bug, the _namemapper.c code needs some love.

Cheers,
-R. Tyler Ballance
--------------------------------------
 Jabber: [email protected]
 GitHub: http://github.com/rtyler
Twitter: http://twitter.com/agentdero
   Blog: http://unethicalblogger.com

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

_______________________________________________
Cheetahtemplate-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)

iEYEARECAAYFAkvA9isACgkQFCbH3D9R4W/foQCdHOjoW8UHD0OwZua3t7It9B1F
7ZUAnjT9NU4wtiBWv85zkMp+wGc7EBYC
=bO6Z
-----END PGP SIGNATURE-----