Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit a433a03

Browse files
committed
abi: the unicode value needs to be converted to str
1 parent 8f2cc20 commit a433a03

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ethereum/abi.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ def encode_single(typ, arg): # pylint: disable=too-many-return-statements,too-m
338338
if not is_string(arg):
339339
raise EncodingError('Expecting string: %r' % arg)
340340

341+
arg = utils.to_string(arg) # py2: force unicode into str
342+
341343
if len(sub): # fixed length
342344
if not 0 <= len(arg) <= int(sub):
343345
raise ValueError('string must be utf8 encoded')

0 commit comments

Comments
 (0)