mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-19 15:53:48 +00:00
cli: decode all cli arguments, assuming that they are utf-8 encoded
Also encode all args to urllib as utf-8 because urllib doesn't handle unicode objects. I'm not sure if it is appropriate to *assume* utf-8 encoding of cli args. Perhaps the Right thing to do is to detect the platform encoding. Any ideas? This patch is mostly due to François Deppierraz.
This commit is contained in:
@ -33,6 +33,12 @@ def runner(argv,
|
||||
stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr,
|
||||
install_node_control=True, additional_commands=None):
|
||||
|
||||
# Convert arguments to unicode
|
||||
new_argv = []
|
||||
for arg in argv:
|
||||
new_argv.append(arg.decode('utf-8'))
|
||||
argv = new_argv
|
||||
|
||||
config = Options()
|
||||
if install_node_control:
|
||||
config.subCommands.extend(startstop_node.subCommands)
|
||||
|
Reference in New Issue
Block a user