transactions (qt): fix opening raw bytes files
(both when trying to "load tx from file", and "load tx from text" > "browse file")
This commit is contained in:
@@ -47,8 +47,13 @@ class ScanQRTextEdit(ButtonsTextEdit, MessageBoxMixin):
|
||||
if not fileName:
|
||||
return
|
||||
try:
|
||||
with open(fileName, "r") as f:
|
||||
data = f.read()
|
||||
try:
|
||||
with open(fileName, "r") as f:
|
||||
data = f.read()
|
||||
except UnicodeError as e:
|
||||
with open(fileName, "rb") as f:
|
||||
data = f.read()
|
||||
data = data.hex()
|
||||
except BaseException as e:
|
||||
self.show_error(_('Error opening file') + ':\n' + repr(e))
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user