[Biopython-dev] [Bug 1687] New: triemodule.c broken under Python2.4

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed Aug 25 11:56:29 EDT 2004


http://bugzilla.open-bio.org/show_bug.cgi?id=1687

           Summary: triemodule.c broken under Python2.4
           Product: Biopython
           Version: Not Applicable
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: Main Distribution
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: f.sohm at whsmithnet.co.uk
                CC: biopython-dev at biopython.org


Biopython (CVS version) does not compile under Python2.4  
  
This is due to a change in the marshall.c in python 2.4.  
The change break triemodule.c  
the call :  
  
if(!(py_marshalled = PyMarshal_WriteObjectToString(py_value)))  
  
break the compilation because the new PyMarshal_WriteObjectToString take 2  
arguments in Python2.4. The second argument being an integer corresponding to  
the version of Marshal used.  
  
Here is a fix :  
  
in the function line 472 of triemodule.c:  
_write_value_to_handle(const void *value, void *handle)   
  
The fix is to replace the following lines :  
  
if(!(py_marshalled = PyMarshal_WriteObjectToString(py_value)))  
        goto _write_value_to_handle_cleanup;  
  
  
by :  
  
#ifdef Py_MARSHAL_VERSION  
   if(!(py_marshalled =   
	PyMarshal_WriteObjectToString(py_value, Py_MARSHAL_VERSION)))  
        goto _write_value_to_handle_cleanup;  
#else  
    if(!(py_marshalled = PyMarshal_WriteObjectToString(py_value)))  
        goto _write_value_to_handle_cleanup;  
#endif  
  
Py_MARSHAL_VERSION is a new macro defined in marshal.h  
It correspond to the version of marshal.c (1 at the moment).  
If Py_MARSHAL_VERSION is not defined we can assume that the Python version is  
less than 2.4 and carry on as normal, otherwise we provide the integer.  
  
I have not verified that triemodule.c still perform as expected but the  
compilation can carry on.  
  
Hope this is helpful  
  
Fred



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
You are on the CC list for the bug, or are watching someone who is.



More information about the Biopython-dev mailing list