mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-21 02:01:31 +00:00
Avoid overthinking encoding when handling usage errors. 'test_unicode_arguments_and_output' still passes on Python 2. Ref #3603.
This commit is contained in:
parent
57cb88638a
commit
621ae58abe
@ -16,7 +16,7 @@ from twisted.internet import defer, task, threads
|
||||
from allmydata.scripts.common import get_default_nodedir
|
||||
from allmydata.scripts import debug, create_node, cli, \
|
||||
admin, tahoe_run, tahoe_invite
|
||||
from allmydata.util.encodingutil import quote_output, quote_local_unicode_path, get_io_encoding
|
||||
from allmydata.util.encodingutil import quote_local_unicode_path
|
||||
from allmydata.util.eliotutil import (
|
||||
opt_eliot_destination,
|
||||
opt_help_eliot_destinations,
|
||||
@ -121,11 +121,7 @@ def parse_or_exit_with_explanation(argv, stdout=sys.stdout):
|
||||
while hasattr(c, 'subOptions'):
|
||||
c = c.subOptions
|
||||
print(str(c), file=stdout)
|
||||
try:
|
||||
msg = e.args[0].decode(get_io_encoding())
|
||||
except Exception:
|
||||
msg = repr(e)
|
||||
print("%s: %s\n" % (sys.argv[0], quote_output(msg, quotemarks=False)), file=stdout)
|
||||
print("%s: %s\n" % (sys.argv[0], e), file=stdout)
|
||||
sys.exit(1)
|
||||
return config
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user