ete icon indicating copy to clipboard operation
ete copied to clipboard

fix etetoolkit/ete#255

Open gaojunxuan opened this issue 2 years ago • 0 comments

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.

gaojunxuan avatar Jun 23 '22 04:06 gaojunxuan