Aliases are Unicode.
authorDaira Hopwood <daira@jacaranda.org>
Mon, 28 Dec 2015 20:01:07 +0000 (20:01 +0000)
committerDaira Hopwood <daira@jacaranda.org>
Mon, 28 Dec 2015 20:12:29 +0000 (20:12 +0000)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/scripts/tahoe_add_alias.py

index f3ed15c4ad49ba617a2f0876032ab6af1241ce58..30794429e22d3590bf3de686963e42edb6824707 100644 (file)
@@ -1,6 +1,9 @@
 
 import os.path
 import codecs
+
+from allmydata.util.assertutil import precondition
+
 from allmydata import uri
 from allmydata.scripts.common_http import do_http, check_http_error
 from allmydata.scripts.common import get_aliases
@@ -29,6 +32,7 @@ def add_line_to_aliasfile(aliasfile, alias, cap):
 def add_alias(options):
     nodedir = options['node-directory']
     alias = options.alias
+    precondition(isinstance(alias, unicode), alias=alias)
     cap = options.cap
     stdout = options.stdout
     stderr = options.stderr
@@ -56,6 +60,7 @@ def create_alias(options):
     # mkdir+add_alias
     nodedir = options['node-directory']
     alias = options.alias
+    precondition(isinstance(alias, unicode), alias=alias)
     stdout = options.stdout
     stderr = options.stderr
     if u":" in alias: