Commit c8f1615
committed
gh-139423: Fix plistlib to preserve carriage returns in XML plist round-trips
plistlib's _escape() function was normalizing \r\n to \n and \r to \n
during XML plist serialization. When the plist was loaded back, the
original carriage return characters were lost because expat also
normalizes newlines in XML character data.
Fix by encoding \r as the XML character reference instead of
converting it to \n. Character references are not subject to XML
newline normalization, so expat correctly decodes back to \r,
preserving the original data during round-trips.1 parent 8000a9d commit c8f1615
File tree
3 files changed
+20
-4
lines changed- Lib
- test
- Misc/NEWS.d/next/Library
3 files changed
+20
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
169 | 167 | | |
170 | 168 | | |
171 | 169 | | |
| 170 | + | |
172 | 171 | | |
173 | 172 | | |
174 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
818 | 818 | | |
819 | 819 | | |
820 | 820 | | |
821 | | - | |
822 | | - | |
| 821 | + | |
823 | 822 | | |
824 | 823 | | |
825 | 824 | | |
826 | 825 | | |
827 | 826 | | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
828 | 841 | | |
829 | 842 | | |
830 | 843 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments