Beta 21 -- Hashing bugfix for 'ASD'-formatted pedigrees

Fixed a bug in the NewAnimal::string_to_int() and LightAnimal::string_to_int() methods. The bug (reported by Matt Kelly) manifested on Windows XP/Python 2.5 and Max OS/X platforms and resulted in the failure of pyp_utils/reorder) to successfully reorder pedigrees when the 'ASD' pedigree format code was used. I believe that the problem was related to the value of sys.maxint, which varies between 32-bit and 64-bit platforms. string_to_int() now uses a hash calculated using the Python MD5 module as the main hashing method, and the old method as a backup should the first throw an exception (such as could be caused by an unsuccessful cast of a long hexadecimal value to a (long) integer). In that case, the old method will now use a hard-coded value in calculating the hash rather than sys.maxint.

This bug did not affect pedigrees coded 'asd'.

Posted by John B. Cole 2007-04-06

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks