File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -603,7 +603,7 @@ def _binary_to_term(i, data):
603603 )
604604 return (i + j , OtpErlangAtom (atom_name ))
605605 elif tag == _TAG_SMALL_ATOM_UTF8_EXT :
606- j = b_ord (data [i : i + 1 ])
606+ j = b_ord (data [i ])
607607 i += 1
608608 atom_name = TypeUnicode (
609609 data [i :i + j ], encoding = 'utf-8' , errors = 'strict'
Original file line number Diff line number Diff line change @@ -128,6 +128,8 @@ def test_binary_to_term_atom(self):
128128 erlang .binary_to_term (b'\x83 d\0 \4 test' ))
129129 self .assertEqual (erlang .OtpErlangAtom (b'test' ),
130130 erlang .binary_to_term (b'\x83 s\4 test' ))
131+ self .assertEqual (erlang .OtpErlangAtom (u'name' ),
132+ erlang .binary_to_term (b'\x83 w\x04 name' ))
131133 def test_binary_to_term_predefined_atoms (self ):
132134 self .assertEqual (True , erlang .binary_to_term (b'\x83 s\4 true' ))
133135 self .assertEqual (False , erlang .binary_to_term (b'\x83 s\5 false' ))
You can’t perform that action at this time.
0 commit comments