Repository navigation
Commit 3e7ff42
fix: Non-ASCII characters (e.g. accented letters) in a data contract … (#1650)
* fix: Non-ASCII characters (e.g. accented letters) in a data contract file were garbled on Windows
* test: cover the fetch_schema UTF-8 reads under a cp1252 default encoding
The non_utf8_default_encoding fixture now mirrors open()'s signature (a positional buffering argument no longer lands in encoding) and also patches io.open, so Path.open and importlib.resources reads default to cp1252 too. New tests check that fetch_schema decodes both the bundled and a local schema file as UTF-8.
* fix: read and write import sources, init templates and config files as UTF-8
Importers (avro, bigquery, dbml, dcs, iceberg, jsonschema, protobuf, sql, unity), datacontract init, the config file and the saved API response of datacontract test used the platform default encoding. On Windows, non-ASCII characters in these files were garbled, or a protobuf source crashed with UnicodeDecodeError.
* test: remove duplicate Excel encoding test
The accented-characters test in test_export_excel.py is redundant — the core
encoding fix is already well-covered by test_lint_files.py, which exercises
the same code path under a cp1252 default encoding via the non_utf8_default_encoding
fixture. There is no Excel-specific behavior to test here.
---------
Co-authored-by: yanchao murong <yamur@Mac.lan>
Co-authored-by: Jakob Schödl <jakob.schoedl@entropy-data.com>1 parent bfdb4f1 commit 3e7ff42
19 files changed
Lines changed: 66 additions & 18 deletions
File tree
- datacontract
- config
- engines
- imports
- init
- lint
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
| 359 | + | |
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
453 | | - | |
| 453 | + | |
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
350 | | - | |
| 350 | + | |
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
0 commit comments