Repository navigation
Commit 400d7a1
committed
test(turn-driver): run the locale evidence child from stdin
Both cases passed the child program as a `-c` argument. CPython decodes
`-c` text with the filesystem encoding, which this fixture forces to ASCII
(`LC_ALL=C`, `-X utf8=0`, `PYTHONCOERCECLOCALE=0`), so on Linux the child
died before importing LoopX: `Unable to decode the command from the
command line` / `UnicodeEncodeError: ... surrogates not allowed`. The
Windows lane passed only because its filesystem encoding is UTF-8.
The program now travels on stdin, which CPython decodes as UTF-8 and which
keeps the working directory on `sys.path` the way `-c` does. The workspace
is the pytest temporary directory rather than a path with a non-ASCII
component: the child addresses it as `str` under that ASCII filesystem
encoding, so such a path would fail on the surrogate escape before the
codec hazard this suite exists to reproduce. The non-ASCII payload stays
in the CLI's UTF-8 event bytes and in the attempt record, so the codec
assertions are unchanged.
Reported by the independent review of a786ed7. Reproduced on Linux
Python 3.12: a786ed7 fails both cases at the command-line decode; this
head passes both, and reverting the observe codec pin still fails both with
`UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 36`.
Signed-off-by: JasonBuildAI <jasonbuildai@gmail.com>1 parent a786ed7 commit 400d7a1
1 file changed
Lines changed: 20 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
14 | 23 | | |
15 | 24 | | |
16 | 25 | | |
| |||
31 | 40 | | |
32 | 41 | | |
33 | 42 | | |
34 | | - | |
35 | | - | |
36 | 43 | | |
37 | 44 | | |
38 | 45 | | |
| |||
128 | 135 | | |
129 | 136 | | |
130 | 137 | | |
131 | | - | |
| 138 | + | |
132 | 139 | | |
133 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
134 | 146 | | |
135 | 147 | | |
136 | 148 | | |
| |||
161 | 173 | | |
162 | 174 | | |
163 | 175 | | |
164 | | - | |
| 176 | + | |
165 | 177 | | |
166 | 178 | | |
167 | 179 | | |
| |||
178 | 190 | | |
179 | 191 | | |
180 | 192 | | |
181 | | - | |
| 193 | + | |
182 | 194 | | |
183 | 195 | | |
184 | 196 | | |
| |||
0 commit comments