mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-19 19:26:25 +00:00
Ported to Python 3.
This commit is contained in:
parent
679319baf4
commit
99f54223ab
@ -1,4 +1,15 @@
|
|||||||
from past.builtins import unicode
|
"""
|
||||||
|
Ported to Python 3.
|
||||||
|
"""
|
||||||
|
from __future__ import absolute_import
|
||||||
|
from __future__ import division
|
||||||
|
from __future__ import print_function
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from future.utils import PY2
|
||||||
|
if PY2:
|
||||||
|
# Don't import bytes and str, to prevent API leakage
|
||||||
|
from future.builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, dict, list, object, range, max, min # noqa: F401
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@ -749,9 +760,9 @@ class Retrieve(object):
|
|||||||
|
|
||||||
blockhashes = dict(enumerate(blockhashes))
|
blockhashes = dict(enumerate(blockhashes))
|
||||||
self.log("the reader gave me the following blockhashes: %s" % \
|
self.log("the reader gave me the following blockhashes: %s" % \
|
||||||
blockhashes.keys())
|
list(blockhashes.keys()))
|
||||||
self.log("the reader gave me the following sharehashes: %s" % \
|
self.log("the reader gave me the following sharehashes: %s" % \
|
||||||
sharehashes.keys())
|
list(sharehashes.keys()))
|
||||||
bht = self._block_hash_trees[reader.shnum]
|
bht = self._block_hash_trees[reader.shnum]
|
||||||
|
|
||||||
if bht.needed_hashes(segnum, include_leaf=True):
|
if bht.needed_hashes(segnum, include_leaf=True):
|
||||||
@ -908,7 +919,7 @@ class Retrieve(object):
|
|||||||
|
|
||||||
|
|
||||||
def notify_server_corruption(self, server, shnum, reason):
|
def notify_server_corruption(self, server, shnum, reason):
|
||||||
if isinstance(reason, unicode):
|
if isinstance(reason, str):
|
||||||
reason = reason.encode("utf-8")
|
reason = reason.encode("utf-8")
|
||||||
storage_server = server.get_storage_server()
|
storage_server = server.get_storage_server()
|
||||||
storage_server.advise_corrupt_share(
|
storage_server.advise_corrupt_share(
|
||||||
|
@ -59,6 +59,7 @@ PORTED_MODULES = [
|
|||||||
"allmydata.mutable.layout",
|
"allmydata.mutable.layout",
|
||||||
"allmydata.mutable.publish",
|
"allmydata.mutable.publish",
|
||||||
"allmydata.mutable.repairer",
|
"allmydata.mutable.repairer",
|
||||||
|
"allmydata.mutable.retrieve",
|
||||||
"allmydata.node",
|
"allmydata.node",
|
||||||
"allmydata.storage_client",
|
"allmydata.storage_client",
|
||||||
"allmydata.storage.common",
|
"allmydata.storage.common",
|
||||||
|
Loading…
Reference in New Issue
Block a user