[PR #3017] [CLOSED] [Other] tests: test_winjob reads tasklist in the console's OEM code page (#2331) #4403

Closed
opened 2026-11-07 15:35:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3017
Author: @Buddychek
Created: 10/18/2026
Status: ❌ Closed

Base: main ← Head: fix/winjob-tasklist-encoding


📝 Commits (2)

  • 031439a tests: test_winjob reads tasklist with the OEM code page - tasklist writes in the console's OEM page (cp850 on a Western European Windows), so its table frame bytes are not valid UTF-8 and text=True raised in the reader thread, leaving stdout None (#2331). encoding='oem' with errors='replace', and the membership check tolerates None. serve/test_winjob.py 3/3 OK
  • d0d32ce tests: test_winjob runs all three classes in both start forms - TestNoThrottle was defined after unittest.main(), so python serve/test_winjob.py skipped it (2/3); the main() call now sits at the file end, so the file form runs 3/3 like the module form already did

📊 Changes

1 file changed (+9 additions, -6 deletions)

View changed files

📝 serve/test_winjob.py (+9 -6)

📄 Description

Problem and result

Two gaps in serve/test_winjob.py:

  1. On a non-English Windows console the test decoded tasklist output as text, and the console's OEM code page mangled it (#2331).
  2. TestNoThrottle was defined after unittest.main(), so python serve/test_winjob.py ran only 2 of the 3 classes; the module form ran all 3.

After: the test reads tasklist's bytes in the console's OEM code page, and the main() call sits at the file end, so the file form runs 3/3 like the module form already did. Test-only change.

Closed in the 0.2.0-beta tracker reset; rebased on main and re-verified per the reset note. #2331 is the OEM code-page report this fixes.

Approach

Read tasklist output as bytes and decode with the console OEM code page; move unittest.main() to the file end.

Validation

Passed, rebased on 0.2.0-beta main (e88ee39d), Windows 11 (German locale), Python 3.15:

  • python serve/test_winjob.py → 3/3 OK, exit 0.
  • python -m unittest serve.test_winjob → 3/3 OK, exit 0.

Not run: CI; English-locale consoles (the OEM decode is locale-independent by construction).

Limits

Test-only; no change to the job-object code under test.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3017 **Author:** [@Buddychek](https://github.com/Buddychek) **Created:** 10/18/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/winjob-tasklist-encoding` --- ### 📝 Commits (2) - [`031439a`](https://github.com/Niko1221/Strata/commit/031439a482e0c3ac32b9b4b7bf1611c183ce8ba0) tests: test_winjob reads tasklist with the OEM code page - tasklist writes in the console's OEM page (cp850 on a Western European Windows), so its table frame bytes are not valid UTF-8 and text=True raised in the reader thread, leaving stdout None (#2331). encoding='oem' with errors='replace', and the membership check tolerates None. serve/test_winjob.py 3/3 OK - [`d0d32ce`](https://github.com/Niko1221/Strata/commit/d0d32ceb69254f5a7e97390d4ef805790b0e5300) tests: test_winjob runs all three classes in both start forms - TestNoThrottle was defined after unittest.main(), so python serve/test_winjob.py skipped it (2/3); the main() call now sits at the file end, so the file form runs 3/3 like the module form already did ### 📊 Changes **1 file changed** (+9 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `serve/test_winjob.py` (+9 -6) </details> ### 📄 Description ### Problem and result Two gaps in `serve/test_winjob.py`: 1. On a non-English Windows console the test decoded `tasklist` output as text, and the console's OEM code page mangled it (#2331). 2. `TestNoThrottle` was defined after `unittest.main()`, so `python serve/test_winjob.py` ran only 2 of the 3 classes; the module form ran all 3. After: the test reads `tasklist`'s bytes in the console's OEM code page, and the `main()` call sits at the file end, so the file form runs 3/3 like the module form already did. Test-only change. ### Related discussion Closed in the 0.2.0-beta tracker reset; rebased on main and re-verified per the reset note. #2331 is the OEM code-page report this fixes. ### Approach Read `tasklist` output as bytes and decode with the console OEM code page; move `unittest.main()` to the file end. ### Validation Passed, rebased on 0.2.0-beta main (`e88ee39d`), Windows 11 (German locale), Python 3.15: - `python serve/test_winjob.py` → 3/3 OK, exit 0. - `python -m unittest serve.test_winjob` → 3/3 OK, exit 0. Not run: CI; English-locale consoles (the OEM decode is locale-independent by construction). ### Limits Test-only; no change to the job-object code under test. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:35:28 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4403
No description provided.