You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect behavior of BytesIO.write() when the size of the written data changed during writing #143602
There is other bug similar to #143378 in the Python implementation of BytesIO.
The buffer is exported twice for the input data. First, to determine the number of bytes, so we can create a slice when overwriting BytesIO data after seeking. Second, to get the data itself. If the number of bytes different, the underlying bytearray object can be shrinked or expanded, with moving bytes after the current position.
Solution -- we need to use the same exported buffer with memoryview() for the whole writing operation. The test will be slightly more complicated variant of the tests added in #143408.
@superboy-zjc, are you interesting to take this issue? It should be easy to you.
Activity
superboy-zjc commentedon Jan 9, 2026
@serhiy-storchaka Yes I am working on it.
pythongh-143602: Fix duplicate buffer exports in io.BytesIO.write
pythongh-143602: fix sphinx lint issue
pythongh-143602: fix sphinx parsing issue
gh-143602: Fix duplicate buffer exports in io.BytesIO.write (#143629)
pythongh-143602: Fix duplicate buffer exports in io.BytesIO.write (py…
[3.14] gh-143602: Fix duplicate buffer exports in io.BytesIO.write (#…
[3.13] gh-143602: Fix duplicate buffer exports in io.BytesIO.write (#…
pythongh-143602: Fix duplicate buffer exports in io.BytesIO.write (py…