Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-134209: use heap-allocated memory in_curses.window.{instr,getstr}
#134283
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
python-cla-botbot commentedMay 19, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
_curses.window.{instr,getstr}
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Misc/NEWS.d/next/Library/2025-05-19-20-59-06.gh-issue-134209.anhTcF.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Ha. As I feared:
I suspect that the value being returned is not reliable for some reason. Unfortunately, we'll need to use |
add version changed messageCo-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
add version changed messageCo-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
…nhTcF.rstCo-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
By the way, no need to hit the "update branch" button if the CI is green. Usually it's only to pull newest (infra-related) changes and/or patches for tests that were already failing. |
picnixz left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Final nitpick. Since I'll be re-changing the logic a bit in#134325, I think this one is good. After the commit, I'll run the build bots.
Uh oh!
There was an error while loading.Please reload this page.
bedevere-bot commentedMay 20, 2025
🤖 New build scheduled with the buildbot fleet by@picnixz for commit6510d09 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F134283%2Fmerge If you want to schedule another build, you need to add the🔨 test-with-buildbots label again. |
bedevere-bot commentedMay 20, 2025
🤖 New build scheduled with the buildbot fleet by@picnixz for commit6510d09 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F134283%2Fmerge If you want to schedule another build, you need to add the🔨 test-with-refleak-buildbots label again. |
picnixz commentedMay 20, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Now, do NOT commit anything until all build bots are done (so don't hit "update branch") otherwise the report will be lost on GH. Thanks for your first contribution! |
Thank you so much to guide me through the process! Glad that I'm able to contribute. |
aadda87
intopython:mainUh oh!
There was an error while loading.Please reload this page.
…getstr}` (pythonGH-134283)* made curses buffer heap allocated instead of stack* change docs to explicitly mention the max buffer size* changing GetStr() function to behave similarly too* Update Doc/library/curses.rst* Update instr with proper return error handling* Update Modules/_cursesmodule.c* change to strlen and better memory safety* change from const int to Py_ssize_t* add mem allocation guard* update versionchanged to mention it was an increase.* explicitly use versionchanged 3.14 as that is its own branch now.TESTED: `python -m test -u curses test_curses`---------(cherry picked from commitaadda87)Co-authored-by: tigerding <43339228+zydtiger@users.noreply.github.com>Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>Co-authored-by: Gregory P. Smith <greg@krypto.org>Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
GH-134391 is a backport of this pull request to the3.14 branch. |
…,getstr}` (GH-134283) (#134391)gh-134209: use heap-allocated memory in `_curses.window.{instr,getstr}` (GH-134283)* made curses buffer heap allocated instead of stack* change docs to explicitly mention the max buffer size* changing GetStr() function to behave similarly too* Update Doc/library/curses.rst* Update instr with proper return error handling* Update Modules/_cursesmodule.c* change to strlen and better memory safety* change from const int to Py_ssize_t* add mem allocation guard* update versionchanged to mention it was an increase.* explicitly use versionchanged 3.14 as that is its own branch now.TESTED: `python -m test -u curses test_curses`---------(cherry picked from commitaadda87)Co-authored-by: tigerding <43339228+zydtiger@users.noreply.github.com>Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>Co-authored-by: Gregory P. Smith <greg@krypto.org>Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Oh so you treated it as a bug fix for 3.14/3.15 only? I'm ok although I would have considered this a feature but since it's scope is really small, it's fine IMO. |
Uh oh!
There was an error while loading.Please reload this page.
Allocated curses buffer on heap and modified documentation to show this change.
_curses.window.{instr,getstr}
#134209📚 Documentation preview 📚:https://cpython-previews--134283.org.readthedocs.build/