From c1d267ba4a0c3e8e13d29cc80da9dc8eba55d2bf Mon Sep 17 00:00:00 2001 From: JackDandy Date: Wed, 8 May 2019 12:51:06 +0100 Subject: [PATCH] =?UTF-8?q?Update=20Tornado=20Web=20Server=205.1.1=20(cc2c?= =?UTF-8?q?f07)=20=E2=86=92=205.1.1=20(a99f1471).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 1 + lib/tornado/util.py | 4 ++-- lib/tornado/web.py | 2 +- lib/tornado/websocket.py | 12 ++++++++---- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a2b44c4..14efee2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ * Update profilehooks module 1.10.1 (fdbf19d) to 1.11.0 (e17f378) * Update scandir 1.9.0 (9ab3d1f) to 1.10.0 (982e6ba) * Update Six compatibility library 1.12.0 (d927b9e) to 1.12.0 (8da94b8) +* Update Tornado Web Server 5.1.1 (cc2cf07) to 5.1.1 (a99f1471) [develop changelog] diff --git a/lib/tornado/util.py b/lib/tornado/util.py index a42ebeb..151b0d8 100644 --- a/lib/tornado/util.py +++ b/lib/tornado/util.py @@ -59,7 +59,7 @@ else: import datetime # noqa import types # noqa from typing import Any, AnyStr, Union, Optional, Dict, Mapping # noqa - from typing import Tuple, Match, Callable # noqa + from typing import List, Tuple, Match, Callable # noqa if PY3: _BaseString = str @@ -252,7 +252,7 @@ _re_unescape_pattern = re.compile(r'\\(.)', re.DOTALL) def re_unescape(s): # type: (str) -> str - """Unescape a string escaped by `re.escape`. + r"""Unescape a string escaped by `re.escape`. May raise ``ValueError`` for regular expressions which could not have been produced by `re.escape` (for example, strings containing diff --git a/lib/tornado/web.py b/lib/tornado/web.py index 6760b0b..4340b16 100644 --- a/lib/tornado/web.py +++ b/lib/tornado/web.py @@ -1887,7 +1887,7 @@ class _ApplicationRouter(ReversibleRuleRouter): class Application(ReversibleRouter): - """A collection of request handlers that make up a web application. + r"""A collection of request handlers that make up a web application. Instances of this class are callable and can be passed directly to HTTPServer to serve the application:: diff --git a/lib/tornado/websocket.py b/lib/tornado/websocket.py index 0b994fc..7b77850 100644 --- a/lib/tornado/websocket.py +++ b/lib/tornado/websocket.py @@ -751,10 +751,14 @@ class WebSocketProtocol13(WebSocketProtocol): self.stream = self.handler.stream self.start_pinging() - open_result = self._run_callback(self.handler.open, *self.handler.open_args, - **self.handler.open_kwargs) - if open_result is not None: - yield open_result + try: + open_result = self.handler.open(*self.handler.open_args, **self.handler.open_kwargs) + if open_result is not None: + yield open_result + except Exception: + self.handler.log_exception(*sys.exc_info()) + self._abort() + yield self._receive_frame_loop() def _parse_extensions_header(self, headers):