[IronPython] bytes and str in 2.7 io module

Jeff Hardy jdhardy at gmail.com
Mon Nov 8 09:36:47 PST 2010


On Mon, Nov 8, 2010 at 10:18 AM, Dino Viehland <dinov at microsoft.com> wrote:
> I think this will be fine.  It will be a binary breaking change (assuming we're talking
> about just changing the return types on types in the io module to object) but we've
> always allowed those between major releases.  I doubt there's many (if any) callers to
> these from C# anyway.

The one function that seems to cause problems (_RawIOBase.read())
already returns object. I think this only crops up when a subclass of
io.RawIOBase overrides read() but returns a string - the io module
will try to cast the result from object to Bytes, and fail with a
TypeError.

This is #29378 if anyone else is interested.

- Jeff


More information about the Users mailing list