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

TermSocket variable _log conflicts with tornado.RequestHandler._log #18

Closed
mgmarino opened this issue Jul 17, 2015 · 0 comments
Closed

Comments

@mgmarino
Copy link
Contributor

I am using tornado version 4.2 and terminado 0.5.

TermSocket defines the variable _log defined here which conflicts with tornado.RequestHandler._log defined here.

This causes an error for example when a class derived from TermSocket throws an exception in get, e.g.:

class TermSocket(terminado.TermSocket):
    def get(self, *args, **kwargs):
        throw web.HTTPError(404)

Stack trace:

ERROR:tornado.application:Exception in exception handler
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/web.py", line 1422, in _execute
    self._handle_request_exception(e)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/web.py", line 1476, in _handle_request_exception
    self.send_error(500, exc_info=sys.exc_info())
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/websocket.py", line 371, in send_error
    super(WebSocketHandler, self).send_error(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/web.py", line 980, in send_error
    self.finish()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/websocket.py", line 389, in _disallow_for_websocket
    method(self, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/web.py", line 936, in finish
    self._log()
TypeError: 'Logger' object is not callable

It is noted in the tornado code that this function is 'somewhat' deprecated. Probably the simplest solution since _log is only used locally is to change the name.

mgmarino added a commit to mgmarino/terminado that referenced this issue Jul 17, 2015
Avoid conflicts with tornado.RequestHandler._log.

Fixes jupyter#18
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

1 participant