[pull] main from python:main - #1403
Merged
Merged
Conversation
…6235) Fix wrong types: instr() and getstr() return a bytes object, not a str, and their n limits the number of bytes; getkey() returns a str; unctrl() returns a bytes object. Make clear whether an integer standing for a character is an encoded byte or a character code. Rewrite the documentation of getch(), get_wch(), getkey(), getstr(), get_wstr(), instr(), in_wstr() and in_wchstr(), following X/Open Curses.
Passing n to the library is ncurses' reading of n: it stores n characters and adds a terminator. NetBSD curses counts the terminator in n. Ask a library that is neither ncurses nor PDCurses for n + 1, and read again if it stored more than asked; truncating could split a multibyte character. This is not possible for input, so getstr() and get_wstr() are left as they are. instr() now takes the length from the value returned by winnstr(), as X/Open specifies, instead of searching for a terminator which it does not.
…H-156262) The pid_t, Py_off_t, HANDLE, DWORD and BOOL converters were defined in 9 files. The Py_off_t type and its converter function are now shared too. DWORD in _winapi is used with bitwise=True to keep accepting negative values. The pid_t converter is now used for the pid parameters in the _remote_debugging module, which were declared as int. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
…156282) instr(), in_wstr() and in_wchstr() clamped the count to 2047 and silently truncated a longer line, which a pad can have. A window read cannot return more than the columns left on the line, in the unit each method counts: cells, characters, or bytes at CCHARW_MAX characters of MB_CUR_MAX bytes per cell. Cap the count by that, and read the rest of the line when the count is omitted, which it now can be. getstr() and get_wstr() read the keyboard rather than the window, so their limit stays.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )