test(archive): decode and encode archive history as UTF-8, not the locale - #167
Conversation
|
That's the fourth area, and the one I want to point at is the eighteenth site — The non-ASCII round-trip test is the right addition too. Every assertion in those files was ASCII, so without it the change would have been a regression guard rather than a reproduction — same reasoning as #153. Merging. That's all four areas, so I'm closing #93 with this — details on that thread. Short version: your part is complete, and re-reading the acceptance list to write that up turned up a real gap in the Windows work that predates you. |
Part of #93, the fourth and last of the four areas we agreed:
/saveoutput paths (#152), daily and status files (#153), executor outputs (#149), and archive history here.Change
18 sites across
test_archive_on_demand_664.py,test_archive_recall_485.pyandtest_ttl_archive_482.pynow nameencoding="utf-8". Seventeen areopen/read_text/write_texton files Palinode itself wrote; the eighteenth is the_githelper'ssubprocess.run, which hadtext=Truewith no encoding and was caught by the guard rather than by me.All three files join
_SWEPT_TEST_FILES, so the area cannot regress.Why the fixtures changed too
Every assertion in these files was ASCII, so they passed with or without the fix and would have been a regression guard rather than a reproduction. Two now carry non-ASCII, matching what #153 did:
test_archive_preserves_the_bodykeepscafé, 日本語in the body it asserts survives.test_archive_history_round_trips_non_asciiis new, and puts a non-ASCII reason through the executor's history writer so the sibling file is read back the waypalinode tracereads it.Validation
74 passed under ASCII stdio and under the normal locale. Reverting just the two read sites makes both new fixtures fail with
UnicodeDecodeError, so they pin the defect rather than guarding a fix.Full suite: 3254 passed, 10 skipped, 5 xfailed. ruff clean.
On closing #93
This finishes the four areas, but the issue's acceptance criteria ask for the suite to be exercised on native Windows, which I still cannot do. The ASCII-stdio harness stands in for cp1252 stdio and catches the decode mismatch, but it is not the same as a Windows run. Your call whether that closes #93 or whether it stays open for a real Windows pass.