From 565c48045e1dd0b685bdd352f584569fc7360ce4 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Fri, 25 Sep 2020 13:28:59 -0400 Subject: [PATCH] Closer to passing tests. --- src/allmydata/immutable/offloaded.py | 6 +++--- src/allmydata/immutable/upload.py | 6 +++--- src/allmydata/test/test_helper.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/allmydata/immutable/offloaded.py b/src/allmydata/immutable/offloaded.py index e04e94e8f..fb8c706a3 100644 --- a/src/allmydata/immutable/offloaded.py +++ b/src/allmydata/immutable/offloaded.py @@ -203,7 +203,7 @@ class CHKUploadHelper(Referenceable, upload.CHKUploader): def _finished(self, ur): assert interfaces.IUploadResults.providedBy(ur), ur vcapstr = ur.get_verifycapstr() - precondition(isinstance(vcapstr, str), vcapstr) + precondition(isinstance(vcapstr, bytes), vcapstr) v = uri.from_string(vcapstr) f_times = self._fetcher.get_times() @@ -492,9 +492,9 @@ class Helper(Referenceable): # helper at random. name = "helper" - VERSION = { "http://allmydata.org/tahoe/protocols/helper/v1" : + VERSION = { b"http://allmydata.org/tahoe/protocols/helper/v1" : { }, - "application-version": str(allmydata.__full_version__), + b"application-version": allmydata.__full_version__.encode("utf-8"), } MAX_UPLOAD_STATUSES = 10 diff --git a/src/allmydata/immutable/upload.py b/src/allmydata/immutable/upload.py index 1ab312ab6..5e38ba31a 100644 --- a/src/allmydata/immutable/upload.py +++ b/src/allmydata/immutable/upload.py @@ -1816,15 +1816,15 @@ class Uploader(service.MultiService, log.PrefixingLogMixin): def _got_helper(self, helper): self.log("got helper connection, getting versions") - default = { "http://allmydata.org/tahoe/protocols/helper/v1" : + default = { b"http://allmydata.org/tahoe/protocols/helper/v1" : { }, - "application-version": b"unknown: no get_version()", + b"application-version": b"unknown: no get_version()", } d = add_version_to_remote_reference(helper, default) d.addCallback(self._got_versioned_helper) def _got_versioned_helper(self, helper): - needed = "http://allmydata.org/tahoe/protocols/helper/v1" + needed = b"http://allmydata.org/tahoe/protocols/helper/v1" if needed not in helper.version: raise InsufficientVersionError(needed, helper.version) self._helper = helper diff --git a/src/allmydata/test/test_helper.py b/src/allmydata/test/test_helper.py index 0b198bb35..0c98e4af8 100644 --- a/src/allmydata/test/test_helper.py +++ b/src/allmydata/test/test_helper.py @@ -218,7 +218,7 @@ class AssistedUpload(unittest.TestCase): d.addCallback(_ready) def _uploaded(results): the_uri = results.get_uri() - assert "CHK" in the_uri + assert b"CHK" in the_uri d.addCallback(_uploaded) def _check_empty(res):