From 8cd2940ebe5749afd4b9e0ebfe2ff2b358c2e42f Mon Sep 17 00:00:00 2001 From: savioratharv <91827941+savioratharv@users.noreply.github.com> Date: Fri, 18 Aug 2023 20:02:13 +0530 Subject: [PATCH] Update tree.py (#215) Line 932 gives this error "UnicodeEncodeError: 'charmap' codec can't encode characters in position 20-22: character maps to " , solved it using the encode function. --- treelib/tree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/treelib/tree.py b/treelib/tree.py index 7d92297..c553859 100644 --- a/treelib/tree.py +++ b/treelib/tree.py @@ -929,7 +929,7 @@ def write(line): print("Tree is empty") if stdout: - print(self._reader) + print(self._reader.encode('utf-8')) else: return self._reader