[pypy-issue] Issue #2498: Cython on PyPy 3: 'dict' object has no attribute 'iteritems' (pypy/pypy)

Konstantin Lopuhin issues-reply at bitbucket.org
Wed Mar 15 10:24:20 EDT 2017

New issue 2498: Cython on PyPy 3: 'dict' object has no attribute 'iteritems'

Konstantin Lopuhin:

I'm not sure if this a Cython or PyPy issue, but importing ``lxml.html`` fails with the following error:
>>>> import lxml.html
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/kostia/tmp/pypy3/site-packages/lxml/html/__init__.py", line 89, in <module>
  File "src/lxml/xpath.pxi", line 420, in lxml.etree.XPath.__init__ (src/lxml/lxml.etree.c:172552)
  File "src/lxml/xpath.pxi", line 150, in lxml.etree._XPathEvaluatorBase.set_context (src/lxml/lxml.etree.c:168951)
  File "src/lxml/xpath.pxi", line 66, in lxml.etree._XPathContext.set_context (src/lxml/lxml.etree.c:167729)
  File "src/lxml/extensions.pxi", line 255, in lxml.etree._BaseContext.registerLocalFunctions (src/lxml/lxml.etree.c:158962)
AttributeError: 'dict' object has no attribute 'iteritems'

I'm using latest pypy 3.5 nightly (http://buildbot.pypy.org/nightly/py3.5/pypy-c-jit-90688-27474b4d14e4-linux64.tar.bz2) with a fix from #2497 that allows lxml installation. System is Ubuntu 16.04. Some other parts of lxml seem to work fine (e.g. lxml.etree).

This is the line where is fails: https://github.com/lxml/lxml/blob/981a760856a15108e7143b1adbc2d07973c7cebb/src/lxml/extensions.pxi#L255 so this looks like ``.iteritems()`` does not work in Cython with PyPy 3.5? Unfortunately, I don't know how Cython and PyPy are integrated - maybe this is a Cython bug?

More information about the pypy-issue mailing list