[Biopython-dev] [Biopython] SeqIO.index improvement suggestions

Peter biopython at maubp.freeserve.co.uk
Wed Feb 24 17:28:58 UTC 2010


On Wed, Feb 24, 2010 at 5:13 PM, Renato Alves <rjalves at igc.gulbenkian.pt> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>>So this does look like a Python 2.x bug which has been fixed in Python
>>3.x, and we should probably report this (after searching to see if it
>>is a known issue).
>
> The closest I could find is: http://bugs.python.org/issue5148
>
> But it's also on gzip.open(), not plain open().

It is gzip.open() that we have a problem with, open() is fine.

It does look like http://bugs.python.org/issue6759 and/or the
linked bug http://bugs.python.org/issue6759 cover this issue.
Thanks for finding them.

>>However, even if it is fixed in Python 2.6.x and 2.7.x, it won't get
>>fixed in older versions like Python 2.4 or 2.5.
>
> Do you raising a warning if the 'U' mode is explicitly passed
> would be a reasonable solution for older python versions?

Are you asking about what I would like Python to do?
I would like gzip.open() to support universal newline mode.

For Biopython's index function we currently don't allow the
user to specify the mode at all - the code decides this based
on the file format (SFF files must be binary, for text files I use
universal newline mode).

Peter



More information about the Biopython-dev mailing list