import fails with Python 3.3 because of __qualname__
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zope.interface |
Fix Released
|
Undecided
|
Tres Seaver |
Bug Description
This happens with the pre-alpha Python 3.3 default branch, zope.interface 3.8.0 installed with pip from PyPI.
Since 25 Nov 2011 Python got a __qualname__ attribute for functions and classes because support for PEP 3155 [1] got merged. When I import zope.interface I get:
Python 3.3.0a0 (default:
[GCC 4.6.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import zope.interface
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/
_wire()
File "/home/
from zope.interface.
File "/home/
class IElement(
File "/home/
raise InvalidInterfac
zope.interface.
I should mention that I know almost nothing about zope.interface, I got the import error by trying out Pyramid on Python 3.3. I can see from the traceback that __qualname__ gets into attrs in the __init__ of InterfaceClass and adding an if name == '__qualname__': continue just like for '__locals__' makes the error go away, however I have no idea if that's the proper fix.
Changed in zope.interface: | |
status: | Fix Committed → Fix Released |
Attaching patch.