]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
BASEDIR/nickname is now UTF-8 encoded
authorBrian Warner <warner@lothar.com>
Sat, 20 Sep 2008 18:37:13 +0000 (11:37 -0700)
committerBrian Warner <warner@lothar.com>
Sat, 20 Sep 2008 18:37:13 +0000 (11:37 -0700)
docs/configuration.txt
src/allmydata/client.py
src/allmydata/introducer/client.py

index a7487a016a46e9e03dc280df2ae894b6201ef183..4826615a474c156dcde4603574f91f0b92f0f295 100644 (file)
@@ -22,7 +22,8 @@ attach a client to that grid
 
 nickname (optional): The contents of this file will be displayed in
 management tools as this node's "nickname". If the file doesn't exist, the
-nickname will be set to "<unspecified>".
+nickname will be set to "<unspecified>". This file shall be a UTF-8 encoded
+unicode string.
 
 webport (optional): This controls where the client's webserver should listen,
 providing filesystem access as defined in webapi.txt . This file contains a
index 850af9fa5947e140ba32f30c99bf41f9f9f23ee3..cb800a8134d0ea2b8caf381d386cfa0ec7b11f52 100644 (file)
@@ -65,9 +65,11 @@ class Client(node.Node, testutil.PollMixin):
         node.Node.__init__(self, basedir)
         self.started_timestamp = time.time()
         self.logSource="Client"
-        self.nickname = self.get_config("nickname")
-        if self.nickname is None:
-            self.nickname = "<unspecified>"
+        nickname_utf8 = self.get_config("nickname")
+        if nickname_utf8:
+            self.nickname = nickname_utf8.decode("utf-8")
+        else:
+            self.nickname = u"<unspecified>"
         self.init_introducer_client()
         self.init_stats_provider()
         self.init_lease_secret()
index 4b9484f9854409b2877cbf9cd77f9a189c1831df..085e0ccce16948a5482989f1c5da5345031ccfd0 100644 (file)
@@ -91,7 +91,7 @@ class IntroducerClient(service.Service, Referenceable):
         self._tub = tub
         self.introducer_furl = introducer_furl
 
-        self._nickname = nickname
+        self._nickname = nickname.encode("utf-8")
         self._my_version = my_version
         self._oldest_supported = oldest_supported