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

Richard Llewellyn llewelr at gmail.com
Tue Jul 24 02:24:06 UTC 2012


With python 3.2 and biopython 1.60 after getting a handle using
Entrez.esummary (and esearch, others?) I get a TypeError:


>>> from Bio import Entrez
>>> Entrez.email = "Your.Name.Here at example.org"
>>> handle = Entrez.esummary(db="journals", id="30367")
>>> record = Entrez.read(handle)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.2/site-packages/Bio/Entrez/__init__.py",
line 351, in read
    record = handler.read(handle)
  File "/usr/local/lib/python3.2/site-packages/Bio/Entrez/Parser.py",
line 169, in read
    self.parser.ParseFile(handle)
TypeError: read() did not return a bytes object (type=str)

>>> handle
<Bio._py3k.EvilHandleHack object at 0xb737a34c>

Ah, it is evil!

I realize py3k not yet officially supported.

Thanks for the great work.



More information about the Biopython mailing list