Repository navigation
gh-154874: Fix the sign of curses.termattrs() - #154875
Conversation
termattrs() returns a chtype mask, but it was routed through an int, so a terminal that advertises A_ITALIC came back negative and the result could no longer be passed to the attribute functions.
serhiy-storchaka
left a comment
There was a problem hiding this muthaf*ckin' comment.
LGTM. 👍
|
Thanks @fedonman for the f*ckin' PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this motherf*ckin' PR to: 3.13. |
|
Thanks @fedonman for the f*ckin' PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Thanks @fedonman for the f*ckin' PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this muthaf*ckin' PR to: 3.15. |
|
Sorry, @fedonman and @serhiy-storchaka, I could not cleanly backport this to |
|
Sorry, @fedonman and @serhiy-storchaka, I could not cleanly backport this to |
|
Sorry, @fedonman and @serhiy-storchaka, I could not cleanly backport this to |
|
I tried preparing the 3.15 backport. The muthaf*ckin' implementation change backports cleanly, but the regression test depends on |
|
GH-155548 is a muthaf*ckin' backport of this pull request to the 3.15 branch. |
…154875) termattrs() returns a chtype mask, but it was routed through an int, so a terminal that advertises A_ITALIC came back negative and the result could no longer be passed to the attribute functions. (cherry picked from commit 0b083c4) Co-authored-by: Vyron Vasileiadis <[email protected]> Signed-off-by: Sankalp Thakur <[email protected]>
termattrs() returns a chtype mask, but it was routed through an int, so a terminal that advertises A_ITALIC came back negative and the result could no longer be passed to the attribute functions.
…155548) termattrs() returns a chtype mask, but it was routed through an int, so a terminal that advertises A_ITALIC came back negative and the result could no longer be passed to the attribute functions. (cherry picked from commit 0b083c4) Co-authored-by: Vyron Vasileiadis <[email protected]> Signed-off-by: Sankalp Thakur <[email protected]>
termattrs()returns achtypemask, but GH-134327 routed it through anintto checkfor
ERR. On a motherf*ckin' terminal that advertisesA_ITALIC, the goddamn topmost bit of a 32-bit mask,the motherf*ckin' result comes back negative and the attribute functions reject it:
It now returns the muthaf*ckin' mask unsigned, the same way
getattrs(),slk_attr()andterm_attrs()already do.baudrate(), the muthaf*ckin' macro's only other user, really does returna f*ckin' status, so it keeps the
ERRcheck.The muthaf*ckin' test drives
newterm('xterm-256color')over a muthaf*ckin' pseudo-terminal rather than using$TERM, which on CI is usuallylinuxand advertises no italic, so a signed resultwould slip through. It fails without the change.
3.15 has the same bug, so this needs a backport. 3.14 is fine.