Fix BytesWarning errors.

This commit is contained in:
Itamar Turner-Trauring 2021-04-22 10:27:59 -04:00
parent b675ca2380
commit a393b54315
3 changed files with 8 additions and 0 deletions

View File

@ -1,4 +1,6 @@
from __future__ import print_function
from past.builtins import unicode
from six import ensure_str
import os, time
@ -26,6 +28,7 @@ class SlowOperationRunner(object):
except UnknownAliasError as e:
e.display(stderr)
return 1
path = unicode(path, "utf-8")
if path == '/':
path = ''
url = nodeurl + "uri/%s" % url_quote(rootcap)

View File

@ -34,6 +34,7 @@ def check_location(options, where):
except UnknownAliasError as e:
e.display(stderr)
return 1
path = str(path, "utf-8")
if path == '/':
path = ''
url = nodeurl + "uri/%s" % url_quote(rootcap)
@ -299,6 +300,7 @@ class DeepCheckStreamer(LineOnlyReceiver, object):
except UnknownAliasError as e:
e.display(stderr)
return 1
path = str(path, "utf-8")
if path == '/':
path = ''
url = nodeurl + "uri/%s" % url_quote(rootcap)

View File

@ -1,5 +1,7 @@
from __future__ import print_function
from past.builtins import unicode
from urllib.parse import quote as url_quote
import json
from twisted.protocols.basic import LineOnlyReceiver
@ -34,6 +36,7 @@ class ManifestStreamer(LineOnlyReceiver, object):
except UnknownAliasError as e:
e.display(stderr)
return 1
path = unicode(path, "utf-8")
if path == '/':
path = ''
url = nodeurl + "uri/%s" % url_quote(rootcap)