This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nikratio
Recipients benjamin.peterson, hynek, loewis, nikratio, pitrou, python-dev, stutzbach, vstinner
Date 2014-06-08.22:17:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I used the wrong interpreter when cutting and pasting the example above, here's the correct version to avoid confusion with the traceback:

>>> import _pyio
>>> from array import array
>>> buf = array('b', b'x' * 10)
>>>'/dev/zero', 'rb').readinto(buf) 
>>> buf = array('B', b'x' * 10)
>>>'/dev/zero', 'rb').readinto(buf)
Traceback (most recent call last):
  File "/home/nikratio/clones/cpython/Lib/", line 662, in readinto
    b[:n] = data
TypeError: can only assign array (not "bytes") to array slice

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/nikratio/clones/cpython/Lib/", line 667, in readinto
    b[:n] = array.array('b', data)
TypeError: bad argument type for built-in operation
Date User Action Args
2014-06-08 22:17:01nikratiosetrecipients: + nikratio, loewis, pitrou, vstinner, benjamin.peterson, stutzbach, python-dev, hynek
2014-06-08 22:17:01nikratiosetmessageid: <>
2014-06-08 22:17:01nikratiolinkissue20578 messages
2014-06-08 22:17:01nikratiocreate