mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-19 21:17:54 +00:00
More unicode-of-bytes fixes.
This commit is contained in:
parent
a06956632b
commit
c5a426b797
@ -63,7 +63,7 @@ class Blacklist(object):
|
|||||||
reason = self.entries.get(si, None)
|
reason = self.entries.get(si, None)
|
||||||
if reason is not None:
|
if reason is not None:
|
||||||
# log this to logs/twistd.log, since web logs go there too
|
# log this to logs/twistd.log, since web logs go there too
|
||||||
twisted_log.msg("blacklist prohibited access to SI %s: %s" %
|
twisted_log.msg("blacklist prohibited access to SI %r: %r" %
|
||||||
(base32.b2a(si), reason))
|
(base32.b2a(si), reason))
|
||||||
return reason
|
return reason
|
||||||
|
|
||||||
|
@ -430,8 +430,8 @@ class IncompleteHashTree(CompleteBinaryTreeMixin, list):
|
|||||||
for i,h in new_hashes.items():
|
for i,h in new_hashes.items():
|
||||||
if self[i]:
|
if self[i]:
|
||||||
if self[i] != h:
|
if self[i] != h:
|
||||||
raise BadHashError("new hash %s does not match "
|
raise BadHashError("new hash %r does not match "
|
||||||
"existing hash %s at %s"
|
"existing hash %r at %r"
|
||||||
% (base32.b2a(h),
|
% (base32.b2a(h),
|
||||||
base32.b2a(self[i]),
|
base32.b2a(self[i]),
|
||||||
self._name_hash(i)))
|
self._name_hash(i)))
|
||||||
|
@ -63,7 +63,7 @@ class SegmentFetcher(object):
|
|||||||
self._running = True
|
self._running = True
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
log.msg("SegmentFetcher(%s).stop" % self._node._si_prefix,
|
log.msg("SegmentFetcher(%r).stop" % self._node._si_prefix,
|
||||||
level=log.NOISY, parent=self._lp, umid="LWyqpg")
|
level=log.NOISY, parent=self._lp, umid="LWyqpg")
|
||||||
self._cancel_all_requests()
|
self._cancel_all_requests()
|
||||||
self._running = False
|
self._running = False
|
||||||
@ -241,7 +241,7 @@ class SegmentFetcher(object):
|
|||||||
# called by Shares, in response to our s.send_request() calls.
|
# called by Shares, in response to our s.send_request() calls.
|
||||||
if not self._running:
|
if not self._running:
|
||||||
return
|
return
|
||||||
log.msg("SegmentFetcher(%s)._block_request_activity: %s -> %s" %
|
log.msg("SegmentFetcher(%r)._block_request_activity: %s -> %r" %
|
||||||
(self._node._si_prefix, repr(share), state),
|
(self._node._si_prefix, repr(share), state),
|
||||||
level=log.NOISY, parent=self._lp, umid="vilNWA")
|
level=log.NOISY, parent=self._lp, umid="vilNWA")
|
||||||
# COMPLETE, CORRUPT, DEAD, BADSEGNUM are terminal. Remove the share
|
# COMPLETE, CORRUPT, DEAD, BADSEGNUM are terminal. Remove the share
|
||||||
|
@ -125,7 +125,7 @@ class DownloadNode(object):
|
|||||||
self.ciphertext_hash_tree_leaves = self.guessed_num_segments
|
self.ciphertext_hash_tree_leaves = self.guessed_num_segments
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "ImmutableDownloadNode(%s)" % (self._si_prefix,)
|
return "ImmutableDownloadNode(%r)" % (self._si_prefix,)
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
# called by the Terminator at shutdown, mostly for tests
|
# called by the Terminator at shutdown, mostly for tests
|
||||||
|
@ -122,7 +122,7 @@ class Retrieve(object):
|
|||||||
_assert(self._node.get_readkey())
|
_assert(self._node.get_readkey())
|
||||||
self._last_failure = None
|
self._last_failure = None
|
||||||
prefix = si_b2a(self._storage_index)[:5]
|
prefix = si_b2a(self._storage_index)[:5]
|
||||||
self._log_number = log.msg("Retrieve(%s): starting" % prefix)
|
self._log_number = log.msg("Retrieve(%r): starting" % prefix)
|
||||||
self._running = True
|
self._running = True
|
||||||
self._decoding = False
|
self._decoding = False
|
||||||
self._bad_shares = set()
|
self._bad_shares = set()
|
||||||
|
@ -915,7 +915,7 @@ def create_main_tub(config, tub_options,
|
|||||||
tubport,
|
tubport,
|
||||||
location,
|
location,
|
||||||
)
|
)
|
||||||
log.msg("Tub location set to %s" % (location,))
|
log.msg("Tub location set to %r" % (location,))
|
||||||
return tub
|
return tub
|
||||||
|
|
||||||
|
|
||||||
|
@ -703,7 +703,7 @@ class StorageServer(service.MultiService, Referenceable):
|
|||||||
si_s = si_b2a(storage_index)
|
si_s = si_b2a(storage_index)
|
||||||
# windows can't handle colons in the filename
|
# windows can't handle colons in the filename
|
||||||
fn = os.path.join(self.corruption_advisory_dir,
|
fn = os.path.join(self.corruption_advisory_dir,
|
||||||
"%s--%s-%d" % (now, si_s, shnum)).replace(":","")
|
"%s--%s-%d" % (now, str(si_s, "utf-8"), shnum)).replace(":","")
|
||||||
with open(fn, "w") as f:
|
with open(fn, "w") as f:
|
||||||
f.write("report: Share Corruption\n")
|
f.write("report: Share Corruption\n")
|
||||||
f.write("type: %s\n" % bytes_to_native_str(share_type))
|
f.write("type: %s\n" % bytes_to_native_str(share_type))
|
||||||
|
@ -843,7 +843,7 @@ class WebErrorMixin(object):
|
|||||||
response_body = f.value.response
|
response_body = f.value.response
|
||||||
if response_substring:
|
if response_substring:
|
||||||
self.failUnless(response_substring in response_body,
|
self.failUnless(response_substring in response_body,
|
||||||
"%s: response substring '%s' not in '%s'"
|
"%r: response substring %r not in %r"
|
||||||
% (which, response_substring, response_body))
|
% (which, response_substring, response_body))
|
||||||
return response_body
|
return response_body
|
||||||
d = defer.maybeDeferred(callable, *args, **kwargs)
|
d = defer.maybeDeferred(callable, *args, **kwargs)
|
||||||
|
Loading…
Reference in New Issue
Block a user