Bitcoin Forum
June 29, 2024, 07:16:05 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Armory silently fails on unrecognized character in address  (Read 667 times)
TimS (OP)
Sr. Member
****
Offline Offline

Activity: 250
Merit: 253


View Profile WWW
April 08, 2015, 01:32:51 AM
 #1

I copy/pasted an address from a page, and it included the character U+2028 (LINE SEPARATOR) at the end. When I clicked Send, it did nothing visible and logged this:

Code:
2015-04-07 20:19 (ERROR) -- Traceback (most recent call last):
  File "ui\TxFrames.pyc", line 758, in createTxAndBroadcast
  File "ui\TxFrames.pyc", line 429, in validateInputsGetUSTX
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2028' in position 33: ordinal not in range(128)

Being a whitespace character, and having no visible error message, it wasn't easy to realize that I had an extra character at the end. I would expect it either to work or to tell me there's a problem with the address.
CryptKeeper
Legendary
*
Offline Offline

Activity: 2044
Merit: 1055



View Profile
April 08, 2015, 02:13:35 PM
 #2

It's an old issue:

https://bitcointalk.org/index.php?topic=56424.msg4446993#msg4446993

I'm not sure if it's already corrected with the newest version. Which armory version are you running?

Follow me on twitter! I'm a private Bitcoin and altcoin hodler. Giving away crypto for free on my Twitter feed!
btchris
Hero Member
*****
Offline Offline

Activity: 672
Merit: 504

a.k.a. gurnec on GitHub


View Profile WWW
April 08, 2015, 02:50:29 PM
Last edit: April 08, 2015, 03:22:30 PM by btchris
 #3

It's an old issue:

https://bitcointalk.org/index.php?topic=56424.msg4446993#msg4446993

I'm not sure if it's already corrected with the newest version. Which armory version are you running?

OP's particular issue doesn't look like it was fixed, but the fix is just a small change. Modify this line:
Code:
addrStr = str(self.widgetTable[row]['QLE_ADDR'].text()).strip()

to something like this:
Code:
addrStr = unicode(self.widgetTable[row]['QLE_ADDR'].text()).strip().encode(errors='replace')

or this if you'd rather use Qt's whitespace stripper instead of Python's (both seem to work for OP's example):
Code:
addrStr = unicode(self.widgetTable[row]['QLE_ADDR'].text().trimmed()).encode(errors='replace')

If an Armory dev doesn't happen to notice this thread, it'd make sense to open an issue on GitHub.
CircusPeanut
Full Member
***
Offline Offline

Activity: 123
Merit: 100


View Profile
April 08, 2015, 03:20:12 PM
 #4

Thanks for the report.  I will add this fix in. If we get enough of these minor fixes we will release a 0.93.2, otherwise the fix will show up in 0.94.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!