← 输入框|github.com|刷新
Skip to content

gh-160781: Fix StringIO.truncate() rejecting sizes above 2**31 - 1 on Windows - #160784

Open
cmaloney wants to merge 3 commits into
python:mainfrom
cmaloney:bio_stringio
Open

cmaloney wants to merge 3 commits into
python:mainfrom
cmaloney:bio_stringio

Conversation

@cmaloney

@cmaloney cmaloney commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

StringIO.truncate() converted its argument with PyLong_AsLong(), which rejects sizes above 2**31 - 1 on Windows where C long is 32-bit. Use PyNumber_AsSsize_t() like the Py_ssize_t Argument Clinic converter it used before.

…- 1 on Windows

StringIO.truncate() converted its argument with PyLong_AsLong(), which
rejects sizes above 2**31 - 1 on Windows where C long is 32-bit.  Use
PyNumber_AsSsize_t() like the Py_ssize_t Argument Clinic converter it
used before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant