diff --git a/src/allmydata/immutable/checker.py b/src/allmydata/immutable/checker.py index 9636b9a2f..c1eb5480d 100644 --- a/src/allmydata/immutable/checker.py +++ b/src/allmydata/immutable/checker.py @@ -477,7 +477,7 @@ class Checker(log.PrefixingLogMixin): monitor): assert precondition(isinstance(verifycap, CHKFileVerifierURI), verifycap, type(verifycap)) - prefix = "%s" % base32.b2a(verifycap.get_storage_index()[:8])[:12] + prefix = str(base32.b2a(verifycap.get_storage_index()[:8])[:12], "utf-8") log.PrefixingLogMixin.__init__(self, facility="tahoe.immutable.checker", prefix=prefix) self._verifycap = verifycap diff --git a/src/allmydata/immutable/encode.py b/src/allmydata/immutable/encode.py index a9835b6b8..bbb7f8123 100644 --- a/src/allmydata/immutable/encode.py +++ b/src/allmydata/immutable/encode.py @@ -106,7 +106,7 @@ class Encoder(object): def __repr__(self): if hasattr(self, "_storage_index"): - return "" % si_b2a(self._storage_index)[:5] + return "" % si_b2a(self._storage_index)[:5] return "" def log(self, *args, **kwargs): diff --git a/src/allmydata/immutable/upload.py b/src/allmydata/immutable/upload.py index 46e01184f..b2c4c744d 100644 --- a/src/allmydata/immutable/upload.py +++ b/src/allmydata/immutable/upload.py @@ -437,7 +437,7 @@ class Tahoe2ServerSelector(log.PrefixingLogMixin): self._reactor = reactor def __repr__(self): - return "" % self.upload_id + return "" % self.upload_id def _create_trackers(self, candidate_servers, allocated_size, file_renewal_secret, file_cancel_secret, create_server_tracker): @@ -1314,7 +1314,7 @@ class CHKUploader(object): storage_index = encoder.get_param("storage_index") self._storage_index = storage_index upload_id = si_b2a(storage_index)[:5] - self.log("using storage index %s" % upload_id) + self.log("using storage index %r" % upload_id) server_selector = Tahoe2ServerSelector( upload_id, self._log_number, diff --git a/src/allmydata/mutable/publish.py b/src/allmydata/mutable/publish.py index 8a760c5d3..86ceb022c 100644 --- a/src/allmydata/mutable/publish.py +++ b/src/allmydata/mutable/publish.py @@ -127,7 +127,7 @@ class Publish(object): self._servermap = servermap self._storage_index = self._node.get_storage_index() self._log_prefix = prefix = si_b2a(self._storage_index)[:5] - num = self.log("Publish(%s): starting" % prefix, parent=None) + num = self.log("Publish(%r): starting" % prefix, parent=None) self._log_number = num self._running = True self._first_write_error = None diff --git a/src/allmydata/mutable/servermap.py b/src/allmydata/mutable/servermap.py index 6d8e7806a..be8033f4d 100644 --- a/src/allmydata/mutable/servermap.py +++ b/src/allmydata/mutable/servermap.py @@ -275,7 +275,7 @@ class ServerMap(object): """Take a versionid, return a string that describes it.""" (seqnum, root_hash, IV, segsize, datalength, k, N, prefix, offsets_tuple) = verinfo - return "seq%d-%s" % (seqnum, base32.b2a(root_hash)[:4]) + return "seq%d-%s" % (seqnum, unicode(base32.b2a(root_hash)[:4], "utf-8")) def summarize_versions(self): """Return a string describing which versions we know about.""" @@ -868,7 +868,7 @@ class ServermapUpdater(object): # ok, it's a valid verinfo. Add it to the list of validated # versions. self.log(" found valid version %d-%s from %s-sh%d: %d-%d/%d/%d" - % (seqnum, base32.b2a(root_hash)[:4], + % (seqnum, unicode(base32.b2a(root_hash)[:4], "utf-8"), server.get_name(), shnum, k, n, segsize, datalen), parent=lp) diff --git a/src/allmydata/storage/server.py b/src/allmydata/storage/server.py index 5f2ef3ac2..5d167bb33 100644 --- a/src/allmydata/storage/server.py +++ b/src/allmydata/storage/server.py @@ -271,7 +271,7 @@ class StorageServer(service.MultiService, Referenceable): si_dir = storage_index_to_dir(storage_index) si_s = si_b2a(storage_index) - log.msg("storage: allocate_buckets %s" % si_s) + log.msg("storage: allocate_buckets %r" % si_s) # in this implementation, the lease information (including secrets) # goes into the share files themselves. It could also be put into a @@ -397,7 +397,7 @@ class StorageServer(service.MultiService, Referenceable): start = time.time() self.count("get") si_s = si_b2a(storage_index) - log.msg("storage: get_buckets %s" % si_s) + log.msg("storage: get_buckets %r" % si_s) bucketreaders = {} # k: sharenum, v: BucketReader for shnum, filename in self._get_bucket_shares(storage_index): bucketreaders[shnum] = BucketReader(self, filename, @@ -602,7 +602,7 @@ class StorageServer(service.MultiService, Referenceable): start = time.time() self.count("writev") si_s = si_b2a(storage_index) - log.msg("storage: slot_writev %s" % si_s) + log.msg("storage: slot_writev %r" % si_s) si_dir = storage_index_to_dir(storage_index) (write_enabler, renew_secret, cancel_secret) = secrets bucketdir = os.path.join(self.sharedir, si_dir) @@ -669,7 +669,7 @@ class StorageServer(service.MultiService, Referenceable): start = time.time() self.count("readv") si_s = si_b2a(storage_index) - lp = log.msg("storage: slot_readv %s %s" % (si_s, shares), + lp = log.msg("storage: slot_readv %r %r" % (si_s, shares), facility="tahoe.storage", level=log.OPERATIONAL) si_dir = storage_index_to_dir(storage_index) # shares exist if there is a file for them