Added ignore to decode function

This commit is contained in:
kuldeep.k@cisinlabs.com 2021-08-31 22:50:41 +05:30
parent 0d59074e44
commit 66d21ec44e
No known key found for this signature in database
GPG Key ID: AF4FB299BF7C7C2A

View File

@ -94,7 +94,7 @@ class namecoinConnection(object):
if not res: if not res:
return (_translate( return (_translate(
"MainWindow", 'The name %1 was not found.' "MainWindow", 'The name %1 was not found.'
).arg(identity.decode('utf-8')), None) ).arg(identity.decode('utf-8', 'ignore')), None)
else: else:
assert False assert False
except RPCError as exc: except RPCError as exc:
@ -105,11 +105,11 @@ class namecoinConnection(object):
errmsg = exc.error errmsg = exc.error
return (_translate( return (_translate(
"MainWindow", 'The namecoin query failed (%1)' "MainWindow", 'The namecoin query failed (%1)'
).arg(errmsg.decode('utf-8')), None) ).arg(errmsg.decode('utf-8', 'ignore')), None)
except AssertionError: except AssertionError:
return (_translate( return (_translate(
"MainWindow", 'Unknown namecoin interface type: %1' "MainWindow", 'Unknown namecoin interface type: %1'
).arg(self.nmctype.decode('utf-8')), None) ).arg(self.nmctype.decode('utf-8', 'ignore')), None)
except Exception: except Exception:
logger.exception("Namecoin query exception") logger.exception("Namecoin query exception")
return (_translate( return (_translate(
@ -133,7 +133,7 @@ class namecoinConnection(object):
_translate( _translate(
"MainWindow", "MainWindow",
'The name %1 has no associated Bitmessage address.' 'The name %1 has no associated Bitmessage address.'
).arg(identity.decode('utf-8')), None) ).arg(identity.decode('utf-8', 'ignore')), None)
def test(self): def test(self):
""" """
@ -162,7 +162,7 @@ class namecoinConnection(object):
_translate( _translate(
"MainWindow", "MainWindow",
'Success! Namecoind version %1 running.').arg( 'Success! Namecoind version %1 running.').arg(
versStr.decode('utf-8'))) versStr.decode('utf-8', 'ignore')))
elif self.nmctype == "nmcontrol": elif self.nmctype == "nmcontrol":
res = self.callRPC("data", ["status"]) res = self.callRPC("data", ["status"])