From 54903fc2eaefc61f500c806ec7adcbee853ff42d Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Sun, 15 Aug 2021 16:24:07 -0400 Subject: [PATCH] handle unicode error for unnormalized names --- lbry/wallet/server/block_processor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lbry/wallet/server/block_processor.py b/lbry/wallet/server/block_processor.py index b10021d1e..caac88d47 100644 --- a/lbry/wallet/server/block_processor.py +++ b/lbry/wallet/server/block_processor.py @@ -411,7 +411,10 @@ class BlockProcessor: def _add_claim_or_update(self, height: int, txo: 'Output', tx_hash: bytes, tx_num: int, nout: int, spent_claims: typing.Dict[bytes, typing.Tuple[int, int, str]]): - claim_name = txo.script.values['claim_name'].decode() + try: + claim_name = txo.script.values['claim_name'].decode() + except UnicodeDecodeError: + claim_name = ''.join(chr(c) for c in txo.script.values['claim_name']) try: normalized_name = txo.normalized_name except UnicodeDecodeError: