Merge pull request #1040 from tahoe-lafs/3675.byteswarning-as-error-again
Make byteswarning an error in Python 3 tests again Fixes ticket:3675
This commit is contained in:
commit
31e64d2211
|
@ -36,7 +36,7 @@ from foolscap.logging.incident import IncidentQualifier
|
|||
if PY3:
|
||||
# Error on BytesWarnings, to catch things like str(b""), but only for
|
||||
# allmydata code.
|
||||
warnings.filterwarnings("error", category=BytesWarning, module="allmydata.*")
|
||||
warnings.filterwarnings("error", category=BytesWarning, module=".*allmydata.*")
|
||||
|
||||
|
||||
class NonQualifier(IncidentQualifier, object):
|
||||
|
|
|
@ -1304,7 +1304,7 @@ class MyShare(object):
|
|||
self._dyhb_rtt = rtt
|
||||
|
||||
def __repr__(self):
|
||||
return "sh%d-on-%s" % (self._shnum, self._server.get_name())
|
||||
return "sh%d-on-%s" % (self._shnum, str(self._server.get_name(), "ascii"))
|
||||
|
||||
class MySegmentFetcher(SegmentFetcher):
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
@ -1383,7 +1383,7 @@ class Selection(unittest.TestCase):
|
|||
self.failUnless(node.failed)
|
||||
self.failUnless(node.failed.check(NotEnoughSharesError))
|
||||
sname = serverA.get_name()
|
||||
self.failUnlessIn("complete= pending=sh0-on-%s overdue= unused=" % sname,
|
||||
self.failUnlessIn("complete= pending=sh0-on-%s overdue= unused=" % str(sname, "ascii"),
|
||||
str(node.failed))
|
||||
d.addCallback(_check2)
|
||||
return d
|
||||
|
@ -1605,7 +1605,7 @@ class Selection(unittest.TestCase):
|
|||
self.failUnless(node.failed)
|
||||
self.failUnless(node.failed.check(NotEnoughSharesError))
|
||||
sname = servers[b"peer-2"].get_name()
|
||||
self.failUnlessIn("complete=sh0 pending= overdue=sh2-on-%s unused=" % sname,
|
||||
self.failUnlessIn("complete=sh0 pending= overdue=sh2-on-%s unused=" % str(sname, "ascii"),
|
||||
str(node.failed))
|
||||
d.addCallback(_check4)
|
||||
return d
|
||||
|
|
|
@ -515,7 +515,7 @@ class RunNode(common_util.SignalMixin, unittest.TestCase, pollmixin.PollMixin):
|
|||
0,
|
||||
"Expected error message from '{}', got something else: {}".format(
|
||||
description,
|
||||
p.get_buffered_output(),
|
||||
str(p.get_buffered_output(), "utf-8"),
|
||||
),
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue