From 16647b49f6c49d7b60a69eed045f27d97985ffb1 Mon Sep 17 00:00:00 2001 From: david-sarah Date: Sun, 1 Aug 2010 17:02:12 -0700 Subject: [PATCH] scripts/create_node.py: allow nickname to be Unicode. Also ensure webport is validly encoded in config file. --- src/allmydata/scripts/create_node.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/allmydata/scripts/create_node.py b/src/allmydata/scripts/create_node.py index d98b421d..8841d350 100644 --- a/src/allmydata/scripts/create_node.py +++ b/src/allmydata/scripts/create_node.py @@ -70,11 +70,14 @@ def write_node_config(c, config): c.write("\n\n") c.write("[node]\n") - c.write("nickname = %s\n" % config.get("nickname", "")) #TODO: utf8 in argv? - webport = config.get("webport", "none") + nickname = argv_to_unicode(config.get("nickname") or "") + c.write("nickname = %s\n" % (nickname.encode('utf-8'),)) + + # TODO: validate webport + webport = argv_to_unicode(config.get("webport") or "none") if webport.lower() == "none": webport = "" - c.write("web.port = %s\n" % webport) + c.write("web.port = %s\n" % (webport.encode('utf-8'),)) c.write("web.static = public_html\n") c.write("#tub.port =\n") c.write("#tub.location = \n") -- 2.45.2