Open hellais opened 7 years ago
I'm not sure what we can/should do here?
In Python3, str
is basically the same as unicode
in Python2: a string with some encoding. We're just assuming everything is UTF8 because Tor doesn't declare encodings for anything, but does allow high-ASCII values in "strings" that come back ...
The reason I think py3-str or unicode is the right answer for GETINFO (and most other things in tor-control-protocol) is because they're "things that get shown to users, or typed in by users" so they should be "a string with an encoding", not just raw bytes.
Since 0.19.0
get_info
commands will return unicode values instead of strings. It could be that other people would also be a bit surprised by this fact, so at the very leasts some note should be added to the changelog to mention this or ideally (if there not a good reason to do so) restore the old behavior of returning strings.Here is a minimal way to reproduce the issue:
The above snippet will succeed in txtorcon 0.18.0, while fail in txtorcon >= 0.19.0