-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Open
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-IOtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
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.
Linked PRs
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-IOtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error