##// END OF EJS Templates
Catch interrupted poll() in terminal console...
Catch interrupted poll() in terminal console Alternative to my own PR #8108 - catch ZMQError in run_cell, and if it's caused by an interrupt, ignore it. more complex, especially if we want to handle the timeout nicely as proposed in the comments, but it's possibly also more convenient for other users of that API. Or perhaps not - I'm not sure what makes sense for other API consumers in this case. Fixes gh-8105

File last commit:

r19156:d3e620f5
r20836:0b3b28de
Show More
handlers.py
23 lines | 715 B | text/x-python | PythonLexer
"""Tornado handlers for security logging."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from tornado import gen, web
from ...base.handlers import IPythonHandler, json_errors
from . import csp_report_uri
class CSPReportHandler(IPythonHandler):
'''Accepts a content security policy violation report'''
@web.authenticated
@json_errors
def post(self):
'''Log a content security policy violation report'''
csp_report = self.get_json_body()
self.log.warn("Content security violation: %s",
self.request.body.decode('utf8', 'replace'))
default_handlers = [
(csp_report_uri, CSPReportHandler)
]