Port to Python 3.

This commit is contained in:
Itamar Turner-Trauring 2021-06-03 09:26:24 -04:00
parent aef8705b6f
commit 53482dd8ac
2 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,14 @@
"""
Ported to Python 3.
"""
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from past.builtins import unicode
from future.utils import PY2
if PY2:
from future.builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, list, object, range, str, max, min # noqa: F401
from urllib.parse import quote as url_quote
from allmydata.scripts.common_http import do_http, check_http_error
@ -37,7 +45,7 @@ def mkdir(options):
return 0
# create a new directory at the given location
path = unicode(path, "utf-8")
path = str(path, "utf-8")
if path.endswith("/"):
path = path[:-1]
# path must be "/".join([s.encode("utf-8") for s in segments])

View File

@ -110,6 +110,7 @@ PORTED_MODULES = [
"allmydata.scripts.tahoe_invite",
"allmydata.scripts.tahoe_ls",
"allmydata.scripts.tahoe_manifest",
"allmydata.scripts.tahoe_mkdir",
"allmydata.scripts.types_",
"allmydata.stats",
"allmydata.storage_client",