[New-bugs-announce] [issue34955] passing a dict to bytes() gives unhelpful error message

Marnanel Thurman report at bugs.python.org
Wed Oct 10 15:55:15 EDT 2018


New submission from Marnanel Thurman <thomas at thurman.org.uk>:

bytes() doesn't accept a dict as parameter. If you attempt to pass one, you receive a TypeError with the baffling message "'str' object cannot be interpreted as an integer".

 >> bytes({'a':1})
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 TypeError: 'str' object cannot be interpreted as an integer

----------
components: Interpreter Core
messages: 327490
nosy: marnanel
priority: normal
severity: normal
status: open
title: passing a dict to bytes() gives unhelpful error message
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34955>
_______________________________________


More information about the New-bugs-announce mailing list