diff --git a/lbrynet/daemon/auth/server.py b/lbrynet/daemon/auth/server.py index 7f5afdc8f..18f228366 100644 --- a/lbrynet/daemon/auth/server.py +++ b/lbrynet/daemon/auth/server.py @@ -1,4 +1,3 @@ -# pylint: skip-file import logging from six.moves.urllib import parse as urlparse import json @@ -517,7 +516,7 @@ class AuthJSONRPCServer(AuthorizedBase): @staticmethod def _check_params(function, args_tup, args_dict): - argspec = inspect.getargspec(undecorated(function)) + argspec = inspect.getfullargspec(undecorated(function)) num_optional_params = 0 if argspec.defaults is None else len(argspec.defaults) duplicate_params = [ @@ -537,7 +536,7 @@ class AuthJSONRPCServer(AuthorizedBase): if len(missing_required_params): return 'Missing required parameters', missing_required_params - extraneous_params = [] if argspec.keywords is not None else [ + extraneous_params = [] if argspec.varkw is not None else [ extra_param for extra_param in args_dict if extra_param not in argspec.args[1:] @@ -566,7 +565,7 @@ class AuthJSONRPCServer(AuthorizedBase): def _callback_render(self, result, request, id_, auth_required=False): try: - encoded_message = jsonrpc_dumps_pretty(result, id=id_, default=default_decimal) + encoded_message = jsonrpc_dumps_pretty(result, id=id_, default=default_decimal).encode() request.setResponseCode(200) self._set_headers(request, encoded_message, auth_required) self._render_message(request, encoded_message) diff --git a/lbrynet/dht/node.py b/lbrynet/dht/node.py index 517abd3a4..f24eeae0c 100644 --- a/lbrynet/dht/node.py +++ b/lbrynet/dht/node.py @@ -348,7 +348,7 @@ class Node(MockKademliaHelper): stored_to = yield DeferredDict({contact: self.storeToContact(blob_hash, contact) for contact in contacts}) contacted_node_ids = [binascii.hexlify(contact.id) for contact in stored_to.keys() if stored_to[contact]] log.debug("Stored %s to %i of %i attempted peers", binascii.hexlify(blob_hash), - len(contacted_node_ids), len(contacts)) + len(list(contacted_node_ids)), len(contacts)) defer.returnValue(contacted_node_ids) def change_token(self): diff --git a/lbrynet/undecorated.py b/lbrynet/undecorated.py index 3395be714..a1d445973 100644 --- a/lbrynet/undecorated.py +++ b/lbrynet/undecorated.py @@ -33,11 +33,11 @@ def undecorated(o): except AttributeError: pass - # try: - # # python3 - # closure = o.__closure__ - # except AttributeError: - # return + try: + # python3 + closure = o.__closure__ + except AttributeError: + return if closure: for cell in closure: