[Biopython] Entrez.read(handle) for Bio._py3k.EvilHandleHack throws error with python 3.2

Peter Cock p.j.a.cock at googlemail.com
Tue Jul 24 09:41:35 UTC 2012


Hi Richard,

It's great to have some feedback on Python 3 support :)

On Tue, Jul 24, 2012 at 4:20 AM, Richard Llewellyn <llewelr at gmail.com> wrote:
> Follow up for Entrez.read error on EvilHandleHack object:
>
> (this is python 3.2.3)
>
> If I change last line of Entrez.__init__.py _open function from
>
> return _binary_to_string_handle(handle)
> to
> return handle
>
> this error does not occur in example given below.

Hmm. That call to _binary_to_string_handle converts from the
bytes (binary) network handle to a string (unicode) handle which
is required for most of the parsers in Biopython under Python 3
(e.g. FASTA, Genbank).

Surprisingly the Entrez parser seems to be wanting a binary
handle? That seems curious... I presume that means we
don't have this particular case covered in the unit tests :(

How familiar are you with the Python 3 split of bytes vs strings
(unicode), and binary versus text handles?

Peter



More information about the Biopython mailing list