Tests pass on Python 3.

This commit is contained in:
Itamar Turner-Trauring 2020-09-18 14:31:23 -04:00
parent 050388ee12
commit c3bb367a93
3 changed files with 5 additions and 4 deletions

View File

@ -127,7 +127,7 @@ class ValidatedExtendedURIProxy(object):
# consistent: codec_name, codec_params, tail_codec_params,
# num_segments, size, needed_shares, total_shares
if 'codec_name' in d:
if d['codec_name'] != "crs":
if d['codec_name'] != b"crs":
raise UnsupportedErasureCodec(d['codec_name'])
if 'codec_params' in d:

View File

@ -1,4 +1,5 @@
from six.moves import cStringIO as StringIO
from io import BytesIO
from zope.interface import implementer
from twisted.internet import defer
from twisted.internet.interfaces import IPushProducer
@ -104,7 +105,7 @@ class LiteralFileNode(_ImmutableFileNodeBase):
# vfs.adapters.ftp._FileToConsumerAdapter), neither of which is
# likely to be used as the target for a Tahoe download.
d = basic.FileSender().beginFileTransfer(StringIO(data), consumer)
d = basic.FileSender().beginFileTransfer(BytesIO(data), consumer)
d.addCallback(lambda lastSent: consumer)
return d

View File

@ -1377,7 +1377,7 @@ class LiteralUploader(object):
self._progress.set_progress_total(size)
return read_this_many_bytes(uploadable, size)
d.addCallback(_got_size)
d.addCallback(lambda data: uri.LiteralFileURI("".join(data)))
d.addCallback(lambda data: uri.LiteralFileURI(b"".join(data)))
d.addCallback(lambda u: u.to_string())
d.addCallback(self._build_results)
return d