Repository navigation
Commit 30eb429
committed
gh-159637: Fix renaming an attribute to a prefixed name in minidom
Document.renameNode() set the new prefix of an attribute before its
new namespace, so the prefix was validated against the old namespace.
Renaming an attribute with no namespace to a prefixed name in a
namespace raised NamespaceErr after the attribute had been removed
from its element.
Set the namespace first, and check the prefix before removing the
attribute, so that a rejected rename leaves the element unchanged.1 parent e5ef47e commit 30eb429
2 files changed
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1880 | 1880 | | |
1881 | 1881 | | |
1882 | 1882 | | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
1883 | 1905 | | |
1884 | 1906 | | |
1885 | 1907 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2129 | 2129 | | |
2130 | 2130 | | |
2131 | 2131 | | |
| 2132 | + | |
| 2133 | + | |
2132 | 2134 | | |
2133 | 2135 | | |
2134 | 2136 | | |
2135 | 2137 | | |
2136 | 2138 | | |
2137 | 2139 | | |
| 2140 | + | |
2138 | 2141 | | |
2139 | 2142 | | |
2140 | | - | |
2141 | 2143 | | |
2142 | 2144 | | |
2143 | 2145 | | |
| |||
0 commit comments