Closed chasezheng closed 6 years ago
Hi, @chasezheng , I agree with your fix: I think the print() statement deals with encoding (well, the call to sys.stdout.write() does, it seems), so there is no need to encode before.
Maybe you could submit a PR with your fix?
Edit: I just saw the __str__
method is an alternative solution (following your example):
>>> print(tree)
Harry
├── Bill
└── Jane
├── Diane
│ └── Mary
└── Mark
This issue drove me nuts for a couple hours until I found out it wasn't me or my system's fault. +1 for a fix please! This library is just what I needed otherwise.
Thanks guys!! :+1:
for example,
To fix this, replace this line https://github.com/caesar0301/treelib/blob/1200ec1d7a1c5cda4508dddbfcc0bc13545ff575/treelib/tree.py#L679 with: print(self.reader)