Commit 20b8418
committed
Fix conversion of PyUnicodeObject to wstring
On Windows, with Python >= 3.3, PyObject_Length cannot be used to get
the size of the wchar_t string, because it will count the number of
*code points*, but some characters not on the BMP will use two UTF-16
*code units* (surrogate pairs).
This is not a problem on Unix, since wchar_t is 32-bit.
This also fixes a problem where test_builtin_converters.py was not
being run, since the module docstring was not the first statement.1 parent 36bbdde commit 20b8418
File tree
2 files changed
+19
-3
lines changed- src/converter
- test
2 files changed
+19
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
433 | 444 | | |
434 | 445 | | |
435 | 446 | | |
| |||
444 | 455 | | |
445 | 456 | | |
446 | 457 | | |
| 458 | + | |
447 | 459 | | |
448 | 460 | | |
449 | 461 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | 4 | | |
8 | 5 | | |
9 | 6 | | |
| |||
136 | 133 | | |
137 | 134 | | |
138 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
286 | 290 | | |
287 | 291 | | |
288 | 292 | | |
| |||
0 commit comments