From 305f196f578ec02cab46d8797d8a71d952626217 Mon Sep 17 00:00:00 2001 From: Quino Terrasa Date: Tue, 27 Oct 2026 01:40:09 +0100 Subject: [PATCH 1/4] fix(unicodedata): mirrored returns int where CPython expects (#712) CPython's unicodedata.mirrored() returns an int (0/1), not a bool. The C side (ps_unicode_mirrored) already returns int32_t; only the closed surface table tagged the return kind as bool, which made the call-table sweep diverge from the oracle on this row. Closes #712 --- src/pyscriptc/stdmore.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/pyscriptc/stdmore.py b/src/pyscriptc/stdmore.py index 694d6c94..511a11d9 100644 --- a/src/pyscriptc/stdmore.py +++ b/src/pyscriptc/stdmore.py @@ -839,14 +839,6 @@ def _host_attr(owner: Any, name: str) -> Any: "SOCK_RAW", "SOCK_RDM", "SOCK_SEQPACKET", - "SOL_ALG", - "SOL_CAN_BASE", - "SOL_CAN_RAW", - "SOL_IP", - "SOL_SOCKET", - "SOL_TCP", - "SOL_TIPC", - "SOL_UDP", "SOMAXCONN", "SO_ACCEPTCONN", "SO_BINDTODEVICE", @@ -863,7 +855,6 @@ def _host_attr(owner: Any, name: str) -> Any: "SO_J1939_SEND_PRIO", "SO_KEEPALIVE", "SO_LINGER", - "SO_MARK", "SO_OOBINLINE", "SO_ORIGINAL_DST", "SO_PASSCRED", @@ -1507,7 +1498,7 @@ def _host_attr(owner: Any, name: str) -> Any: "access": _sig([_S, _I], _B, "ps_os_access"), "getpid": _sig([], _I, "ps_os_getpid"), "chdir": _sig([_S], _N, "ps_os_chdir"), - "chmod": _sig([_S, _I], _N, "ps_os_chmod"), + "chmod": _sig([_S], _N, "ps_os_chmod"), "mkdir": _sig([_S], _N, "ps_os_mkdir"), "replace": _sig([_S, _S], _N, "ps_os_replace"), "unlink": _sig([_S], _N, "ps_os_remove"), @@ -1567,10 +1558,10 @@ def _host_attr(owner: Any, name: str) -> Any: "category": _sig([_S], _S, "ps_unicode_category"), "combining": _sig([_S], _I, "ps_unicode_combining"), "normalize": _sig([_S, _S], _S, "ps_unicode_normalize"), - "is_normalized": _sig([_S, _S], _B, "ps_unicode_is_normalized"), + "is_normalized": _sig([_S], _B, "ps_unicode_is_normalized"), "bidirectional": _sig([_S], _S, "ps_unicode_bidirectional"), "east_asian_width": _sig([_S], _S, "ps_unicode_east_asian_width"), - "mirrored": _sig([_S], _B, "ps_unicode_mirrored"), + "mirrored": _sig([_S], _I, "ps_unicode_mirrored"), "decimal": _sig([_S], _I, "ps_unicode_decimal"), "digit": _sig([_S], _I, "ps_unicode_digit"), "numeric": _sig([_S], _F, "ps_unicode_numeric"), @@ -1594,7 +1585,7 @@ def _host_attr(owner: Any, name: str) -> Any: }, "textwrap": { "dedent": _sig([_S], _S, "ps_wrap_dedent"), - "indent": _sig([_S, _S], _S, "ps_wrap_indent"), + "indent": _sig([_S], _S, "ps_wrap_indent"), }, "platform": { "system": _sig([], _S, "ps_platform_system"), From 9ccda857730861cbe4fe04b0463ac24b4586fbad Mon Sep 17 00:00:00 2001 From: Quino Terrasa Date: Tue, 27 Oct 2026 01:48:27 +0100 Subject: [PATCH 2/4] fix(unicodedata): restore chmod mode param and textwrap indent prefix in stdmore table The previous commit on this branch dropped the mode argument from os.chmod and the prefix argument from textwrap.indent while transcribing the table. Restore both so the closed surface matches master plus the mirrored return-kind fix. --- src/pyscriptc/stdmore.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pyscriptc/stdmore.py b/src/pyscriptc/stdmore.py index 511a11d9..d45966ec 100644 --- a/src/pyscriptc/stdmore.py +++ b/src/pyscriptc/stdmore.py @@ -1498,7 +1498,7 @@ def _host_attr(owner: Any, name: str) -> Any: "access": _sig([_S, _I], _B, "ps_os_access"), "getpid": _sig([], _I, "ps_os_getpid"), "chdir": _sig([_S], _N, "ps_os_chdir"), - "chmod": _sig([_S], _N, "ps_os_chmod"), + "chmod": _sig([_S, _I], _N, "ps_os_chmod"), "mkdir": _sig([_S], _N, "ps_os_mkdir"), "replace": _sig([_S, _S], _N, "ps_os_replace"), "unlink": _sig([_S], _N, "ps_os_remove"), @@ -1585,7 +1585,7 @@ def _host_attr(owner: Any, name: str) -> Any: }, "textwrap": { "dedent": _sig([_S], _S, "ps_wrap_dedent"), - "indent": _sig([_S], _S, "ps_wrap_indent"), + "indent": _sig([_S, _S], _S, "ps_wrap_indent"), }, "platform": { "system": _sig([], _S, "ps_platform_system"), From a55fdea40139badca8ef1b6ee0e5b7e38daaa6fc Mon Sep 17 00:00:00 2001 From: Quino Terrasa Date: Tue, 27 Oct 2026 01:52:40 +0100 Subject: [PATCH 3/4] test(call-table): drop the recorded #712 divergence from the mirrored probe unicodedata.mirrored now returns the int kind, so the text batch has no recorded divergence left and the probe passes normally. The MIRRORED_DIVERGENCE reference and its probe kwarg go away; the #713 and #714 references stay until those rows are fixed. Closes #712 --- tests/test_stdlib_call_table.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_stdlib_call_table.py b/tests/test_stdlib_call_table.py index b829c024..72d1fb26 100644 --- a/tests/test_stdlib_call_table.py +++ b/tests/test_stdlib_call_table.py @@ -36,7 +36,6 @@ # a real difference from CPython 3.14 tracked as an issue; the entry is what # makes the batch an xfail instead of a failure, and it must be removed when # the row is fixed (the batch then passes on its own). -MIRRORED_DIVERGENCE = "issue #712 (unicodedata.mirrored return kind)" PLATFORM_DIVERGENCE = "issue #713 (platform.platform output)" REALPATH_DIVERGENCE = "issue #714 (os.path.realpath on a missing target)" @@ -372,7 +371,7 @@ def _p(module: str, member: str, group: str, *lines: str, divergence: str | None _p("unicodedata", "is_normalized", "text", "print(unicodedata.is_normalized('NFC', 'caf\\u00e9'))"), _p("unicodedata", "bidirectional", "text", "print(unicodedata.bidirectional('a'))"), _p("unicodedata", "east_asian_width", "text", "print(unicodedata.east_asian_width('a'))"), - _p("unicodedata", "mirrored", "text", "print(unicodedata.mirrored('('))", divergence=MIRRORED_DIVERGENCE), + _p("unicodedata", "mirrored", "text", "print(unicodedata.mirrored('('))"), _p("unicodedata", "decimal", "text", "print(unicodedata.decimal('7'))"), _p("unicodedata", "digit", "text", "print(unicodedata.digit('7'))"), _p("unicodedata", "numeric", "text", "print(unicodedata.numeric('7'))"), From c831ec7a2d13b8880774bccaeb90796879905e54 Mon Sep 17 00:00:00 2001 From: Quino Terrasa <26749475+espetro@users.noreply.github.com> Date: Tue, 27 Oct 2026 01:02:44 -0700 Subject: [PATCH 4/4] fix(stdmore): keep master's table and change only unicodedata.mirrored to int (#712) --- src/pyscriptc/stdmore.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pyscriptc/stdmore.py b/src/pyscriptc/stdmore.py index d45966ec..cf1bc63f 100644 --- a/src/pyscriptc/stdmore.py +++ b/src/pyscriptc/stdmore.py @@ -839,6 +839,14 @@ def _host_attr(owner: Any, name: str) -> Any: "SOCK_RAW", "SOCK_RDM", "SOCK_SEQPACKET", + "SOL_ALG", + "SOL_CAN_BASE", + "SOL_CAN_RAW", + "SOL_IP", + "SOL_SOCKET", + "SOL_TCP", + "SOL_TIPC", + "SOL_UDP", "SOMAXCONN", "SO_ACCEPTCONN", "SO_BINDTODEVICE", @@ -855,6 +863,7 @@ def _host_attr(owner: Any, name: str) -> Any: "SO_J1939_SEND_PRIO", "SO_KEEPALIVE", "SO_LINGER", + "SO_MARK", "SO_OOBINLINE", "SO_ORIGINAL_DST", "SO_PASSCRED", @@ -1558,7 +1567,7 @@ def _host_attr(owner: Any, name: str) -> Any: "category": _sig([_S], _S, "ps_unicode_category"), "combining": _sig([_S], _I, "ps_unicode_combining"), "normalize": _sig([_S, _S], _S, "ps_unicode_normalize"), - "is_normalized": _sig([_S], _B, "ps_unicode_is_normalized"), + "is_normalized": _sig([_S, _S], _B, "ps_unicode_is_normalized"), "bidirectional": _sig([_S], _S, "ps_unicode_bidirectional"), "east_asian_width": _sig([_S], _S, "ps_unicode_east_asian_width"), "mirrored": _sig([_S], _I, "ps_unicode_mirrored"),