Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
90b20675
Commit
90b20675
authored
Dec 28, 2010
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#10777: fix iteration over dict keys while mutating the dict.
parent
ff52f760
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
Lib/test/test_xml_etree.py
Lib/test/test_xml_etree.py
+9
-0
Lib/xml/etree/ElementTree.py
Lib/xml/etree/ElementTree.py
+1
-1
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_xml_etree.py
View file @
90b20675
...
...
@@ -1841,6 +1841,15 @@ def check_issue6565():
"""
def
check_issue10777
():
"""
Registering a namespace twice caused a "dictionary changed size during
iteration" bug.
>>> ET.register_namespace('test10777', 'http://myuri/')
>>> ET.register_namespace('test10777', 'http://myuri/')
"""
# --------------------------------------------------------------------
...
...
Lib/xml/etree/ElementTree.py
View file @
90b20675
...
...
@@ -1068,7 +1068,7 @@ _serialize = {
def
register_namespace
(
prefix
,
uri
):
if
re
.
match
(
"ns
\
d+$
"
, prefix):
raise ValueError("
Prefix
format
reserved
for
internal
use
")
for k, v in
_namespace_map.items(
):
for k, v in
list(_namespace_map.items()
):
if k == uri or v == prefix:
del _namespace_map[k]
_namespace_map[uri] = prefix
...
...
Misc/NEWS
View file @
90b20675
...
...
@@ -18,6 +18,9 @@ Core and Builtins
Library
-------
- Issue #10777: Fix "dictionary changed size during iteration" bug in
ElementTree register_namespace().
- Issue #10626: test_logging now preserves logger disabled states.
- Issue #10774: test_logging now removes temp files created during tests.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment