tor-prompt command 'GETINFO desc/all-recent > /dev/null' fails
If redirection is used, it fails:
$ tor-prompt --run 'GETINFO desc/all-recent' 1>/dev/null
Traceback (most recent call last):
File "/path/to/stem/tor-prompt", line 8, in <module>
stem.interpreter.main()
File "/path/to/stem/stem/interpreter/__init__.py", line 151, in main
interpreter.run_command(args.run_cmd, print_response = True)
File "/path/to/stem/stem/util/conf.py", line 289, in wrapped
return func(*args, config = config, **kwargs)
File "/path/to/stem/stem/interpreter/commands.py", line 381, in run_command
print(output)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u021b' in position 1237805: ordinal not in range(128)
If redirection is not used, it works.
I think atagar is right in his comment:
I suspect the issue is that you're using python3, and that
tor-prompt
is usingprint()
which expect unicode. Server descriptors can have non-ascii content on contact lines which can cause the stacktrace you cited above.
I probably need to add some escaping within
tor-prompt
.
Trac:
Username: wagon