Digging further, I found that the error can be fixed with
```
io.open(self.filename, mode='r', encoding='utf-8')
```
in `_read`, just as described in [1]. Note that
```
self._contents.encode()
```
needs to become
```
self._contents.encode('utf-8')
```
then, too.

[1] https://stackoverflow.com/a/844443/353337

Reply via email to