Commit f97a56e
authored
Support running stubtest in non-UTF8 terminals (#19085)
Fixes #19071. I looked through the `open()` calls in the codebase, and
only `reports.py` raises some concerns. Stubtest crashes due to this
`print` call with incompatible encoding.
I tested this on Linux with `LC_CTYPE=ru_RU.CP1251` (random non-utf8
locale I found in `/usr/share/i18n/SUPPORTED`) and confirmed that
`stubtest` crashes without the patch and passes with it.
Using a simple MRE (empty stub file and `A = "╙"` in a file, this symbol
is `$'\u2559'`), I got this:
```
error: package.A is not present in stub
Stub: in file /tmp/tmp.Cs4RioNSuR/demo/stub/package/__init__.pyi
MISSING
Runtime:
'?'
Found 1 error (checked 1 module)
```
Without the patch I get a crash - same as in the linked issue.1 parent b18d3f8 commit f97a56e
1 file changed
+14
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2062 | 2062 | | |
2063 | 2063 | | |
2064 | 2064 | | |
2065 | | - | |
| 2065 | + | |
2066 | 2066 | | |
2067 | 2067 | | |
2068 | 2068 | | |
| |||
2102 | 2102 | | |
2103 | 2103 | | |
2104 | 2104 | | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
2105 | 2118 | | |
2106 | 2119 | | |
2107 | 2120 | | |
| |||
0 commit comments