Loading ...
Sorry, an error occurred while loading the content.

4923Re: [Cheetahtemplate-discuss] Compiling _namewrapper.c against Python 2.4

Expand Messages
  • R. Tyler Croy
    Nov 2, 2010
    • 0 Attachment
      On Tue, 02 Nov 2010, Fred Ludlow wrote:

      > Hi,
      >
      > I think an oldish bug has resurfaced (see
      > http://web.archiveorange.com/archive/v/GBNPV1aKn5iohvd2oUFP). I just tried
      > to build Cheetah 2.4.3 on a CentOS 5 virtual server running python 2.4 and
      > couldn't compile _namewrapper.c as PyUnicode_FromFormat isn't defined for
      > python 2.4.


      What version of Python 2.4 is this? I'm building the current release just fine
      on Python 2.4.6/amd64.




      > I've sort of fixed this (in the sense it now builds, can import _namewrapper
      > and runs without warnings) by
      >
      > 1) adding the macro definition suggested in the above thread to
      > cheetah/c/cheetah.h
      > ie.
      > #ifndef PyUnicode_FromFormat
      > #define PyUnicode_FromFormat(a,b) PyString_FromFormat(a,b)
      > #endif
      >
      > 2) Changing the call to this macro in _namewrapper.c line 61 to only take 2
      > arguments (However, I did this just by ditching the 2nd argument (excValue)
      > and removing the relevant '%U' from the format string, ie. the line now
      > reads:
      > newExcValue = PyUnicode_FromFormat("Exception while searching for
      > \'%s\'",fullName);
      >
      > I'm not familiar with the Python C API (or C really), so not really sure
      > what the best (and probably very simple) way to fix this properly is, but
      > thought this might provide some help for anyone in a similar position.
      >
      > Cheers,
      >
      > Fred

      > ------------------------------------------------------------------------------
      > Nokia and AT&T present the 2010 Calling All Innovators-North America contest
      > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
      > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
      > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
      > http://p.sf.net/sfu/nokia-dev2dev

      > _______________________________________________
      > Cheetahtemplate-discuss mailing list
      > Cheetahtemplate-discuss@...
      > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

      - R. Tyler Croy
      --------------------------------------
      GitHub: http://github.com/rtyler
      Twitter: http://twitter.com/agentdero
    • Show all 4 messages in this topic