Repository navigation
gh-159739: Recheck BytesIO state after converting truncate size - #160190
JelleZijlstra merged 2 commits into
Conversation
A size object's __index__() can close a BytesIO or export its buffer after truncate() checks the stream. Continuing can dereference a cleared buffer or resize storage behind a live view. Recheck the stream state after size conversion. Backport to 3.15 and 3.14; on 3.14, put the regression test in Lib/test/test_memoryio.py.
|
Thanks @jelle-openai for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
|
Thanks @jelle-openai for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Thanks @jelle-openai for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
…pythonGH-160190) A size object's __index__() can close a BytesIO or export its buffer after truncate() checks the stream. Continuing can dereference a cleared buffer or resize storage behind a live view. Recheck the stream state after size conversion. Backport to 3.15 and 3.14; on 3.14, put the regression test in Lib/test/test_memoryio.py. (cherry picked from commit 8bfda55) Co-authored-by: Jelle Zijlstra <jelle@openai.com>
|
GH-160384 is a backport of this pull request to the 3.15 branch. |
|
GH-160385 is a backport of this pull request to the 3.14 branch. |
|
Sorry @jelle-openai and @JelleZijlstra, I had trouble completing the backport. Please retry by removing and re-adding the "needs backport to 3.14" label. |
…pythonGH-160190) A size object's __index__() can close a BytesIO or export its buffer after truncate() checks the stream. Continuing can dereference a cleared buffer or resize storage behind a live view. Recheck the stream state after size conversion. Backport to 3.15 and 3.14; on 3.14, put the regression test in Lib/test/test_memoryio.py. (cherry picked from commit 8bfda55) Co-authored-by: Jelle Zijlstra <jelle@openai.com>
|
Sorry @jelle-openai and @JelleZijlstra, I had trouble completing the backport. Please retry by removing and re-adding the "needs backport to 3.15" label. |
GH-160190) (#160384) A size object's __index__() can close a BytesIO or export its buffer after truncate() checks the stream. Continuing can dereference a cleared buffer or resize storage behind a live view. Recheck the stream state after size conversion. Backport to 3.15 and 3.14; on 3.14, put the regression test in Lib/test/test_memoryio.py. (cherry picked from commit 8bfda55) Co-authored-by: Jelle Zijlstra <jelle@openai.com>
GH-160190) (#160385) A size object's __index__() can close a BytesIO or export its buffer after truncate() checks the stream. Continuing can dereference a cleared buffer or resize storage behind a live view. Recheck the stream state after size conversion. Backport to 3.15 and 3.14; on 3.14, put the regression test in Lib/test/test_memoryio.py. (cherry picked from commit 8bfda55) Co-authored-by: Jelle Zijlstra <jelle@openai.com>
A size object's
__index__()can close a BytesIO or export its buffer after truncate() checks the stream. Continuing can dereference a cleared buffer or resize storage behind a live view. Recheck the stream state after size conversion. Backport to 3.15 and 3.14; on 3.14, put the regression test in Lib/test/test_memoryio.py.