Repository navigation
Commit b43b686
committed
fix(tests): read and write test model files as UTF-8
`test_value_iteration_parity` wrote its model with `Path.write_text`,
which uses the locale encoding. The model contains the `⟂`
complementarity symbol (`\u27c2`), so on Windows (cp1252) the write
raised `UnicodeEncodeError` and the test failed on py312 and py313.
The library already decodes model files as UTF-8
(`dolo.misc.display.read_file_or_url`), so pass `encoding="utf-8"` when
writing. Same for the read/write pair in `test_time_iteration_parity`,
which was only surviving on ASCII content.
Reproduced by forcing an ASCII locale
(`LC_ALL=C PYTHONCOERCECLOCALE=0 PYTHONUTF8=0 pytest ...`): it failed
before and passes after.1 parent 2d81019 commit b43b686
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
567 | | - | |
| 567 | + | |
568 | 568 | | |
569 | 569 | | |
570 | | - | |
| 570 | + | |
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
| |||
850 | 850 | | |
851 | 851 | | |
852 | 852 | | |
853 | | - | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
854 | 857 | | |
855 | 858 | | |
856 | 859 | | |
| |||
0 commit comments