Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with cythonized interfaces #47

Open
hoefling opened this issue Aug 12, 2016 · 1 comment
Open

Issue with cythonized interfaces #47

hoefling opened this issue Aug 12, 2016 · 1 comment

Comments

@hoefling
Copy link

hoefling commented Aug 12, 2016

When compiling interfaces into shared objects, zope cannot resolve them correctly. For an SSCCE, the compiled example interface from https://docs.zope.org/zope.interface/README.html raises

zope.interface.exceptions.InvalidInterface: Concrete attribute, name

I collected the procedure in a bash script (https://gist.github.com/hoefling/c113a46f1690118ef4bde3114b2960c7). It generates a python module containing the interface and a test script that tries to import that interface:

Without cythonizing:

$ source zopetest-generator 
$ python /tmp/tester.py 
import succeeded

With cythonizing:

$ source zopetest-generator --cythonize
$ python /tmp/tester.py 
Traceback (most recent call last):
  File "/tmp/tester.py", line 2, in <module>
    from zopetest.interface import IFoo
  File "zopetest/interface.py", line 2, in init zopetest.interface (/tmp/zopetest/interface.c:984)
  File "/usr/lib64/python3.5/site-packages/zope/interface/interface.py", line 369, in __init__
    raise InvalidInterface("Concrete attribute, " + name)
zope.interface.exceptions.InvalidInterface: Concrete attribute, bar
@tseaver
Copy link
Member

tseaver commented Dec 6, 2016

@hoefling Thanks for the report! I'm not set up to make the --cythonize version run easily. Can you add some debugging to zope.interface.interface.InterfaceClass.__init__ to determine the name(s) / type(s) of the attributes which trigger the exception?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants