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

TypeError: Class advice impossible in Python3. Use the @implementer class decorator instead. #111

Open
cpg1111 opened this issue Jun 25, 2016 · 4 comments
Labels

Comments

@cpg1111
Copy link

cpg1111 commented Jun 25, 2016

Hi,
I see to run into an error trying to create a Klein process. When using python 3.5.1, twisted 16.2.0 and Klein 0.2.3 (or 0.2.1) I receive a TypeError: Class advice impossible in Python3. Use the @implementer class decorator instead. on a rather basic bit of code:

from klein import Klein
from twisted import inlineCallbacks, returnValue

app = Klein()

@app.route("/")
@inlineCallbacks
def hello(request):
    returnValue("hello")

app.run("0.0.0.0", 8080)

I also import a separate module using umongo with txmongo, but I don't beleive those should collide.

This is the stack trace I receive:

raceback (most recent call last):
  File "/opt/src/auth.py", line 3, in <module>
    from klein import Klein
  File "/usr/local/lib/python3.5/site-packages/klein/__init__.py", line 1, in <module>
    from klein.app import Klein, run, route, resource
  File "/usr/local/lib/python3.5/site-packages/klein/app.py", line 32, in <module>
    class KleinRequest(object):
  File "/usr/local/lib/python3.5/site-packages/klein/app.py", line 33, in KleinRequest
    implements(IKleinRequest)
  File "/usr/local/lib/python3.5/site-packages/zope/interface/declarations.py", line 412, in implements
    raise TypeError(_ADVICE_ERROR % 'implementer')
TypeError: Class advice impossible in Python3.  Use the @implementer class decorator instead.
@cpg1111
Copy link
Author

cpg1111 commented Jun 25, 2016

Seems there's newer versions than what's on the github release page?

@wsanchez wsanchez added the bug label Oct 13, 2016
@Kentoseth
Copy link

@cpg1111 Did you fix this? why is your Klein version so outdated? When installing in a virtualenv via pip the version of Klein (as at 24 November 2016) is: klein-15.3.1

@cpg1111
Copy link
Author

cpg1111 commented Nov 25, 2016

@Kentoseth I was specifying the version based on what was the release tag in the github repo's release page. I saw there were newer version in the separate documentation site. I'm curious why the documentation and the github releases are out of sync?

@wsanchez
Copy link
Member

There's a 16.12 release out now; try that. The release process is still being sorted out.

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

No branches or pull requests

3 participants