8000 gh-129005: Update _pyio.BytesIO to use bytearray.resize on write by cmaloney · Pull Request #129702 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-129005: Update _pyio.BytesIO to use bytearray.resize on write #129702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update comment
  • Loading branch information
cmaloney committed Feb 5, 2025
commit e1929030ff11fb05ea7d3b2b3b59ac6db945c66e
2 changes: 1 addition & 1 deletion Lib/_pyio.py
665C
Original file line numberDiff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ def write(self, b):
return 0
pos = self._pos
if pos > len(self._buffer):
# Expand the buffer to be able to hold the new bytes.
# Pad buffer to pos with null bytes.
self._buffer.resize(pos)
self._buffer[pos:pos + n] = b
self._pos += n
Expand Down
Loading
0