[Biopython] [Entrez] bytes objects has no attribute 'read'

c.buhtz at posteo.jp c.buhtz at posteo.jp
Sat Dec 19 12:55:29 UTC 2015


Don't know what is going on here.
The used zip file has two xml-files with eFetch-records in it.

>>> import Bio.Entrez, zipfile;
>>> z = zipfile.ZipFile('test.zip')
>>> h = z.read(z.namelist()[0])
>>> r = Bio.Entrez.parse(h)
>>> r
<generator object parse at 0xb6c2bcac>
>>> for i in r:
...  print(i)
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/dist-packages/Bio/Entrez/Parser.py",
line 243, in parse text = handle.read(BLOCK)
AttributeError: 'bytes' object has no attribute 'read'

Any idea?
-- 
GnuPGP-Key ID 0751A8EC


More information about the Biopython mailing list