[Python-3000] need help fixing broken tests in py3k-pep3137 branch

Adam Hupp adam at hupp.org
Sat Nov 3 18:57:39 CET 2007

On 11/3/07, Brett Cannon <brett at python.org> wrote:
> > test_array
> _fileio.c for read() calls is using PyBytes instead of PyString, so a
> type check in array.array().fromfile() is failing.  I am assuming that
> _fileio.c should be moved from PyBytes to PyString, right?

Should array.fromfile accept any kind of byte buffer out of .read() or
is it important to only accept PyString?  Changing .fromfile to use
_CheckBuffer instead of Bytes_Check also works.

Also in array,  I'm not sure if array('u',...) .tofile and .fromfile
works correctly.    Currently tofile writes out the raw unicode bytes
without any encoding, and fromfile reads in without any decoding.   It
seems like that could cause problems between e.g. 4 byte and 2 byte
unicode builds, not to mention endianess issues.

Adam Hupp | http://hupp.org/adam/

More information about the Python-3000 mailing list