AttributeError: dict object has no attribute iteritems
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Fix Released
|
Low
|
scoder |
Bug Description
I get this stack trace when trying to invoke lxml.html functionality on Python 3.3 64-bit on Windows 8:
Traceback (most recent call last):
File "c:\python\
"__main__", fname, loader, pkg_name)
File "c:\python\
exec(code, run_globals)
File "C:\Users\
reswarm()
File "C:\Users\
[swarm(
File "C:\Users\
[swarm(
File "C:\Users\
form.fields = dict(tag=tag)
File "c:\python\
for key, value in value.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'
The issue is that iteritems isn't a method name in Python 3. It should be just 'items'.
I'm using lxml 3.1.0.
How is lxml source generated for Python 3? Does it run through 2to3 or is it a unified code base? I've installed lxml from the Windows installer provided here: http://
I recognize it's possible the bug resides with the way the package was built for Windows. If you believe that is the case, can you indicate to me where the 2to3 conversion would happen to account for that change?
Otherwise, I suspect this issue might reside on other platforms/builds as well. Please advise.
Changed in lxml: | |
milestone: | none → 3.1 |
Thanks! Fix is here:
https:/ /github. com/lxml/ lxml/commit/ a79e1d19665bbff 2388494e33b435a d32e63f9fc
2to3 isn't used, all Python code runs in Py2 and Py3 alike (well, except for bugs like this...)