Commit 918e0dd
committed
pyexpat, sys: state why the two name unwraps are the strict encode
`parser_create3` and `sys_audit` both take their name argument through
`str_utf8_w`, which refuses a lone surrogate, where `space.text_w` upstream does
not. Neither site said why.
For pyexpat the reason is a reader: both stored names come back out through
`w_str_get_value`, which panics on a lone surrogate --
`declared_or_forced_encoding` for the encoding, `namespace_separator` for the
separator. The refusal at the door is what keeps those reads from aborting the
process. The `namespace_separator` arm carried no comment at all; the encoding
arm's pointed at the separator arm rather than at the reader.
For `sys.audit` nothing stores the event, so the encode exists only for the
error it raises; the doc comment now says so.
Comment-only.
Assisted-by: Claude1 parent d83185d commit 918e0dd
2 files changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1764 | 1764 | | |
1765 | 1765 | | |
1766 | 1766 | | |
1767 | | - | |
1768 | | - | |
1769 | | - | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
1770 | 1773 | | |
1771 | 1774 | | |
1772 | 1775 | | |
1773 | 1776 | | |
1774 | 1777 | | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
1775 | 1781 | | |
1776 | 1782 | | |
1777 | 1783 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2460 | 2460 | | |
2461 | 2461 | | |
2462 | 2462 | | |
| 2463 | + | |
| 2464 | + | |
| 2465 | + | |
| 2466 | + | |
2463 | 2467 | | |
2464 | 2468 | | |
2465 | 2469 | | |
| |||
0 commit comments