[IronPython] bytes and str in 2.7 io module

Jeff Hardy jdhardy at gmail.com
Sun Nov 7 20:23:52 CET 2010


In IronPython 2.7, the io classes are pretty strict that subclasses
must return bytes from read(). However, in CPython, bytes is an alias
for str, and therefore returning a str is perfectly valid. In
particular, the gzip module does this, and trying to fix it to handle
bytes is a never-ending journey and could very well break other
things. I think changing io to be less strict and accept strings as a
result from read() is a better option.

Is there anything that likely to be broken by doing so?

- Jeff



More information about the Ironpython-users mailing list