Skip to content

Conversation

@thalesmello
Copy link
Contributor

@thalesmello thalesmello commented Apr 5, 2019

Code was raising exception when:

Python 3.7.2 (default, Feb 12 2019, 08:16:38)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import erlang
>>> from base64 import b64decode
>>> print(erlang.binary_to_term(b64decode('g3cEbmFtZQ==')))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/thales/projects/erlang_py/erlang.py", line 421, in binary_to_term
    i, term = _binary_to_term(1, data)
  File "/Users/thales/projects/erlang_py/erlang.py", line 609, in _binary_to_term
    data[i:i + j], encoding='utf-8', errors='strict'
TypeError: unsupported operand type(s) for +: 'int' and 'bytes'

@thalesmello thalesmello changed the title Fix byte conversion to into integer Fix byte to integer conversion Apr 5, 2019
@okeuday okeuday merged commit 6ab100d into okeuday:master Apr 5, 2019
@okeuday
Copy link
Owner

okeuday commented Apr 5, 2019

Thanks for the fix! The same problem exists in a few other places and I will add a commit for those after the merge.

@thalesmello thalesmello mentioned this pull request Apr 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants