Skip to content

Commit 7f12432

Browse files
kiraskylerniuwanli
andauthored
Fix encode during show(stdout=True) (#230)
Co-authored-by: niuwanli <[email protected]>
1 parent de9a4a9 commit 7f12432

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

treelib/tree.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,7 @@ def show(
948948
:param reverse: the ``reverse`` param for sorting :class:`Node` objects in the same level.
949949
:param line_type:
950950
:param data_property: the property on the node data object to be printed.
951+
:param stdout: if True print it, if False return printing.
951952
:param sorting: if True perform node sorting, if False return
952953
nodes in original insertion order. In latter case @key and
953954
@reverse parameters are ignored.
@@ -975,7 +976,7 @@ def write(line):
975976
print("Tree is empty")
976977

977978
if stdout:
978-
print(self._reader.encode("utf-8"))
979+
print(self._reader)
979980
else:
980981
return self._reader
981982

0 commit comments

Comments
 (0)