Some progress towards passing on Python 3.

This commit is contained in:
Itamar Turner-Trauring 2021-05-10 12:03:58 -04:00
parent 109829dfcb
commit 3f2571480c

View File

@ -5,12 +5,14 @@ from __future__ import (
division,
)
from six import ensure_text
import json
from os.path import (
join,
)
from urlparse import (
from urllib.parse import (
urlsplit,
)
@ -68,7 +70,7 @@ def _connect_client(reactor, api_auth_token, ws_url):
factory = WebSocketClientFactory(
url=ws_url,
headers={
"Authorization": "{} {}".format(SCHEME, api_auth_token),
"Authorization": "{} {}".format(str(SCHEME, "ascii"), api_auth_token),
}
)
factory.protocol = _StreamingLogClientProtocol
@ -127,7 +129,7 @@ def _test_streaming_logs(reactor, temp_dir, alice):
node_url = cfg.get_config_from_file("node.url")
api_auth_token = cfg.get_private_config("api_auth_token")
ws_url = node_url.replace("http://", "ws://")
ws_url = ensure_text(node_url).replace("http://", "ws://")
log_url = ws_url + "private/logs/v1"
print("Connecting to {}".format(log_url))