Updated code quality replaced unicode by decode function in api.py
This commit is contained in:
parent
3450066ea2
commit
7702b33ac2
|
@ -642,7 +642,7 @@ class BMRPCDispatcher(object):
|
||||||
% type(eighteenByteRipe))
|
% type(eighteenByteRipe))
|
||||||
label = self._decode(label, "base64")
|
label = self._decode(label, "base64")
|
||||||
try:
|
try:
|
||||||
unicode(label, 'utf-8')
|
label.decode('utf-8')
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
raise APIError(17, 'Label is not valid UTF-8 data.')
|
raise APIError(17, 'Label is not valid UTF-8 data.')
|
||||||
queues.apiAddressGeneratorReturnQueue.queue.clear()
|
queues.apiAddressGeneratorReturnQueue.queue.clear()
|
||||||
|
@ -773,7 +773,7 @@ class BMRPCDispatcher(object):
|
||||||
# It would be nice to make the label the passphrase but it is
|
# It would be nice to make the label the passphrase but it is
|
||||||
# possible that the passphrase contains non-utf-8 characters.
|
# possible that the passphrase contains non-utf-8 characters.
|
||||||
try:
|
try:
|
||||||
unicode(passphrase, 'utf-8')
|
passphrase.decode('utf-8')
|
||||||
label = str_chan + ' ' + passphrase
|
label = str_chan + ' ' + passphrase
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
label = str_chan + ' ' + repr(passphrase)
|
label = str_chan + ' ' + repr(passphrase)
|
||||||
|
@ -805,7 +805,7 @@ class BMRPCDispatcher(object):
|
||||||
# It would be nice to make the label the passphrase but it is
|
# It would be nice to make the label the passphrase but it is
|
||||||
# possible that the passphrase contains non-utf-8 characters.
|
# possible that the passphrase contains non-utf-8 characters.
|
||||||
try:
|
try:
|
||||||
unicode(passphrase, 'utf-8')
|
passphrase.decode('utf-8')
|
||||||
label = str_chan + ' ' + passphrase
|
label = str_chan + ' ' + passphrase
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
label = str_chan + ' ' + repr(passphrase)
|
label = str_chan + ' ' + repr(passphrase)
|
||||||
|
@ -1192,7 +1192,7 @@ class BMRPCDispatcher(object):
|
||||||
if label:
|
if label:
|
||||||
label = self._decode(label, "base64")
|
label = self._decode(label, "base64")
|
||||||
try:
|
try:
|
||||||
unicode(label, 'utf-8')
|
label.decode('utf-8')
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
raise APIError(17, 'Label is not valid UTF-8 data.')
|
raise APIError(17, 'Label is not valid UTF-8 data.')
|
||||||
self._verifyAddress(address)
|
self._verifyAddress(address)
|
||||||
|
|
Reference in New Issue
Block a user