caesar0301 / treelib

An efficient implementation of tree data structure in python 2/3.
http://treelib.readthedocs.io/en/latest/
Other
812 stars 186 forks source link

Make .show() work on unicode strings. Fixes #38 #40

Closed dourvaris closed 9 years ago

dourvaris commented 9 years ago

Not sure if testing outputted bytes like this is the most elegant way.

Should also have a side effect of testing unicode identifiers in general across the lib.

Natim commented 9 years ago

Usually in Python we are trying to do the reverse thing.

Decoding when getting inside Python and encoding when getting outside of Python.

Here you are using BytesIO but I think you should be using StringIO instead.

dourvaris commented 9 years ago

Since .show() was 'printing' to stdout which would want bytes, thats the end result format to check.

Natim commented 9 years ago

Good point.