Repository navigation
Commit 6cd8320
committed
test: robustness on Python 3.14 / 3.14t CI (UnicodeDecodeError + timing flake)
Two version-specific CI failures, both in tests (no production change):
- test_path_traversal_security.py: on Python 3.14 (Windows) url2pathname raises
UnicodeDecodeError while decoding the overlong-UTF-8 ``%c0%af`` payload, where
<3.14 replaces the bytes and returns a literal not-found name (LookupError).
Either way the payload is rejected -- never a leak -- so accept both outcomes:
the sentinel property test swallows any find() exception, and the
double-encoded test asserts (LookupError, UnicodeDecodeError) for the overlong
case while still pinning the valid ``%252f`` case to LookupError.
- test_quadratic_dos.py: the SyllableTokenizer linearity ratio test flaked on the
free-threaded 3.14t runner -- a 4000-rep base tokenize measured ~0.01s, below
timer resolution, so a noisy fast baseline made a linear run look super-linear.
Use a larger base (8000/32000) so the measurement is well above timer noise and
take the median of 3 runs; an 8x threshold still cleanly separates linear
(~4x) from the pre-fix O(n^2) (~16x). Verified stable across repeated runs.1 parent e965330 commit 6cd8320
2 files changed
Lines changed: 34 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
153 | 156 | | |
154 | 157 | | |
155 | 158 | | |
| |||
175 | 178 | | |
176 | 179 | | |
177 | 180 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
183 | 184 | | |
184 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
185 | 191 | | |
186 | 192 | | |
187 | 193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
235 | | - | |
236 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
237 | 245 | | |
238 | 246 | | |
239 | 247 | | |
240 | | - | |
241 | | - | |
242 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
243 | 258 | | |
244 | 259 | | |
245 | 260 | | |
| |||
0 commit comments