3 Commits
Author SHA1 Message Date
Jeong, YunWon 5b1a1c08d7 Leave a byte that starts no UTF-8 sequence at the end of a console write (#8621)
* Leave a byte that starts no UTF-8 sequence at the end of a console write

`find_last_utf8_boundary` read every byte at or above 0xc0 as the start of a
sequence, giving 0xf8..=0xff an expected length of 4 and cutting the tail back
to before it.  `_find_last_utf8_boundary` stops the four-byte range at 0xf8 and
returns the full length for anything above it, leaving the byte for
MultiByteToWideChar to answer with U+FFFD.

`write_console_utf8` therefore reported fewer bytes written than it was given
whenever one of those bytes fell in the last three, and for a buffer that began
with one it cut the length to 0, converted nothing and returned Ok(0) -- a
write that never advances.

The scan also ran a fourth iteration the C loop does not; the arms happen to
answer the same there, but the bound is now the same 3.

* Drop the expectedFailure on test_winconsoleio's test_write

The marker went stale with the boundary fix in the parent commit.  The test
writes `b'\xff'*10` and `data + b'\xff'` to CONOUT$ and asserts the returned
count, which is the case `find_last_utf8_boundary` was answering wrong, so
regrtest now reports it as an unexpected success.
2026-08-30 23:35:08 +09:00
Shahar Naveh 221d95cbbe Run windows tests with -u all (#8134)
* Enable all test resources on windows

* Mark tests

* mark wmi test
2026-06-22 16:46:53 +09:00
CPython Developers 0b0450e7da Update test_winconsoleio from v3.14.3 2026-02-16 00:31:57 +09:00