From 40c2371e77ae01817567d25b4b7cd8c01f46c1fa Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 6 Feb 2008 02:50:34 -0700 Subject: [PATCH] download.py: make logging safe in ValidatedBucket --- src/allmydata/download.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/allmydata/download.py b/src/allmydata/download.py index 592ae42f..a8c6a3e9 100644 --- a/src/allmydata/download.py +++ b/src/allmydata/download.py @@ -159,6 +159,7 @@ class ValidatedBucket: def _got_data(self, res, blocknum): sharehashes, blockhashes, blockdata = res + blockhash = None # to make logging it safe try: if not self._share_hash: @@ -197,7 +198,7 @@ class ValidatedBucket: received from the remote peer were bad.""") log.msg(" have self._share_hash: %s" % bool(self._share_hash)) log.msg(" block length: %d" % len(blockdata)) - log.msg(" block hash: %s" % idlib.b2a_or_none(blockhash)) # not safe + log.msg(" block hash: %s" % idlib.b2a_or_none(blockhash)) if len(blockdata) < 100: log.msg(" block data: %r" % (blockdata,)) else: -- 2.45.2