ete
ete copied to clipboard
fix etetoolkit/ete#255
The export()
function of Phyloxml
class uses write(..)
inconsistently. In some places, byte arguments are given to write(..)
(e.g. Line 1681 of ete/phyloxml/_phyloxml.py
)
outfile.write(str(self.valueOf_).encode(ExternalEncoding))
whereas in other places, arguments to write(..)
are formatted strings (e.g. Line 1685 of the same file)
outfile.write('>')
This causes problem when exporting an Phyloxml object to stdout or a file. This is bug is likely due to the difference in the write(..)
function between Python 2 and 3, as discussed in issue #255.
This pull request fixes issue #255 by removing .encode(ExternalEncoding)
from all write(..)
function calls so that all arguments to the write(..)
function are strings.