You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following was found testing the Biopython unit tests (latest code from git) against Python 3.2 beta 2 (compiled from source on 64 bit Linux Ubuntu). Reduced test case:
$ python3.2
Python 3.2b2 (r32b2:87398, Dec 26 2010, 19:01:30)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from xml.etree import ElementTree
>>> ElementTree.register_namespace("xs", "http://www.w3.org/2001/XMLSchema")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/peterjc/lib/python3.2/xml/etree/ElementTree.py", line 1071, in register_namespace
for k, v in _namespace_map.items():
RuntimeError: dictionary changed size during iteration
Suggested fix, replace this:
defregister_namespace(prefix, uri):
ifre.match("ns\d+$", prefix):
raiseValueError("Prefix format reserved for internal use")
fork, vin_namespace_map.items():
ifk==uriorv==prefix:
del_namespace_map[k]
_namespace_map[uri] =prefixwithsomethinglikethis:
defregister_namespace(prefix, uri):
ifre.match("ns\d+$", prefix):
raiseValueError("Prefix format reserved for internal use")
fork, vinlist(_namespace_map.items()):
ifk==uriorv==prefix:
del_namespace_map[k]
_namespace_map[uri] =prefix
Note that cElementTree seems to be OK.
Note that Python 3.1 was not affected as it didn't even have register_namespace,
$ python3
Python 3.1.2 (r312:79147, Sep 27 2010, 09:57:50)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from xml.etree import ElementTree
>>> ElementTree.register_namespace("xs", "http://www.w3.org/2001/XMLSchema")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'register_namespace'
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: