[issue27261] io.BytesIO.truncate does not work as advertised

Anton Barkovsky report at bugs.python.org
Fri Oct 12 06:55:18 EDT 2018


Anton Barkovsky <anton at swarmer.me> added the comment:

I'm willing to try to fix this behavior.

I just want to check that this would not be considered breaking backwards compatibility. I can imagine in theory some code relying on it, but I would say that it would be relying on a bug. If some code is passed BytesIO in place of a file, then the current behavior is clearly undesirable. If some code specifically uses BytesIO and relies on this... I guess this can happen, but should be very rare and contrary to widely documented behavior. So it seems ok to just fix this, but I'm not very familiar with how such changes are usually handled in cPython, so I'd like to get approval from someone experienced.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27261>
_______________________________________


More information about the Python-bugs-list mailing list