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

Guido van Rossum guido at python.org
Sat Nov 3 23:52:09 CET 2007


On 11/3/07, Adam Hupp <adam at hupp.org> wrote:
> 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.

This behavior is correct -- it is how it always worked in 2.x. The
array module writes machine specific data in general (try floats or
doubles or ints). For machine-independent binary data, the struct
module can help.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list