[Biopython-dev] Python 2.6

Peter biopython at maubp.freeserve.co.uk
Fri Oct 3 12:44:25 UTC 2008


I've now got Python 2.6, numpy 1.2 and Biopython CVS installed on a
linux machine and can confirm Bruce's observations.  I haven't yet
installed MySQLdb in order to verify BioSQL is still fine with Python
2.6.  I have fixed the exception problem with test_PDB.py on python
2.6.

>> With Python 2.6, running tests gave two warnings (should I file a bug
>> report?):
>> biopython/build/lib.linux-x86_64-2.6/Bio/Data/CodonTable.py:580:
>> DeprecationWarning: the sets module is deprecated
>>  from sets import Set
>
> As of python 2.4, set (note lower case) became a built in function
> (like list).  As we still support Python 2.3, avoiding this
> deprecation would need something like:
>
> try :
>   #This should work on python 2.4+
>    Set = set
> except NameError:
>   from sets import Set
> #The remaining code can use Set as before...
>
> Or something similar if we switch all the calls to Set() to the newer
> set() instead.

I could test this change, or work on variant using set() by default.
Does anyone have a preference?

>> biopython/build/lib.linux-x86_64-2.6/Bio/Crystal/__init__.py:42:
>> DeprecationWarning: BaseException.message has been deprecated as of Python
>> 2.6
>>  self.message = message
>
> I'm not immediately sure how to fix that, lets see if anyone on the
> list has a quick suggestion.

This is probably also due to an exception class change in python 2.6,
similar to that which broke test_PDB (bug 2605).

>> Also I got three errors with Python 2.6 (without the -3 flag as that
>> provides warnings for Python 3) so I filed bug reports:
>> test_CAPS
>> test_PDB
>> test_Restriction
>>
>> The failure for test_CAPS and and test_Restriction is due to the same line
>> "Bio/Restriction/Restriction.py" (line 217).

Bug 2604, http://bugzilla.open-bio.org/show_bug.cgi?id=2604
This seems to be due to the python 2.6 changes to the python built in
super.  I've tried emailing Frédéric Sohm who wrote this code, but I'm
not sure if the email address I used is still valid.

Bug 2605, test_PDB failure is now fixed (it was using old style exceptions)
http://bugzilla.open-bio.org/show_bug.cgi?id=2605

Peter




More information about the Biopython-dev mailing list