Commit 0cc1275
committed
pythongh-99064: Ignore the encoding declaration when parsing decoded text (pythonGH-156734)
ElementTree.parse() with a text file mis-decoded the text in the C
implementation: _parse_whole() encoded it as UTF-8, but left expat to honor
the encoding declared in the document. It now overrides the encoding, as
XMLParser.feed() already does for str data.
(cherry picked from commit c83013c)1 parent b93576a commit 0cc1275
3 files changed
Lines changed: 40 additions & 0 deletions
File tree
- Lib/test
- Misc/NEWS.d/next/Library
- Modules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1058 | 1058 | | |
1059 | 1059 | | |
1060 | 1060 | | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
1061 | 1089 | | |
1062 | 1090 | | |
1063 | 1091 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4084 | 4084 | | |
4085 | 4085 | | |
4086 | 4086 | | |
| 4087 | + | |
4087 | 4088 | | |
4088 | 4089 | | |
4089 | 4090 | | |
| |||
4100 | 4101 | | |
4101 | 4102 | | |
4102 | 4103 | | |
| 4104 | + | |
| 4105 | + | |
| 4106 | + | |
| 4107 | + | |
| 4108 | + | |
4103 | 4109 | | |
4104 | 4110 | | |
4105 | 4111 | | |
| |||
4123 | 4129 | | |
4124 | 4130 | | |
4125 | 4131 | | |
| 4132 | + | |
4126 | 4133 | | |
4127 | 4134 | | |
4128 | 4135 | | |
| |||
0 commit comments