-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tree.show prints binary literal to stdout #221
Comments
Also encountered this issue. As a temporary workaround I changed this line:
To:
In virtual environment it was in |
I'm also affected by this bug. Thanks @Lab-Brat for the workaround. |
There's no need to need to patch the module as a workaround. tree.show() does return the output as a string when told not to write to stdout. So just do that as an argument to print: Keep pythons utf-8 handling in mind though. You might want to set the output encoding to utf-8 due to that. |
- At least on Python 3, instead of a nicely formatted tree the former command showed a byte string (b'...'). - See also caesar0301/treelib#221
I have this problem, too. Fedora 40, Gnome 46, Python 3.11 in virtual environment |
…x9c\xe2\x94\x80\xe2\x94\x80 Solution: pass stdout=False to tree.show() to make it return a string and pass that to print() issue: caesar0301#221
Issue #82 seems to have been reintroduced at some point after release 1.3.2:
results in:
b'Harry\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 Bill\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 Jane\n \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 Diane\n \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 Mary\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 Mark\n'
The text was updated successfully, but these errors were encountered: