[Biopython] PDBIO.save(fh) in BioPython 1.80 always closes the file handle
Adam Sjøgren
asjo at koldfront.dk
Wed Dec 7 13:35:15 EST 2022
Adam writes:
> tmp = StringIO()
Adding:
import types
tmp.close=types.MethodType(lambda _: True, tmp)
here is a workaround.
> io.save(tmp)
> tmp.seek(0)
> # Get content
> content = tmp.read().encode('utf-8')
But it feels wrong :-)
/Adam
--
"A cat has nine lives, but a bullfrog croaks every Adam Sjøgren
day." asjo at koldfront.dk
More information about the Biopython
mailing list