|
15 | 15 | import warnings |
16 | 16 | from collections.abc import Awaitable, Coroutine, Sequence |
17 | 17 | from http.client import responses |
18 | | -from logging import Logger |
19 | 18 | from typing import TYPE_CHECKING, Any, cast |
20 | 19 | from urllib.parse import urlparse |
21 | 20 |
|
|
44 | 43 | ) |
45 | 44 |
|
46 | 45 | if TYPE_CHECKING: |
| 46 | + from logging import Logger |
| 47 | + |
47 | 48 | from jupyter_client.kernelspec import KernelSpecManager |
48 | 49 | from jupyter_events import EventLogger |
49 | 50 | from jupyter_server_terminals.terminalmanager import TerminalManager |
@@ -774,7 +775,7 @@ def write_error(self, status_code: int, **kwargs: Any) -> None: |
774 | 775 | # backward-compatibility: traceback field is present, |
775 | 776 | # but always empty |
776 | 777 | reply["traceback"] = "" |
777 | | - self.log.warning("wrote error: %r", reply["message"], exc_info=True) |
| 778 | + self.log.warning("wrote error: %r", reply["message"]) |
778 | 779 | self.finish(json.dumps(reply)) |
779 | 780 |
|
780 | 781 | def get_login_url(self) -> str: |
@@ -1055,7 +1056,7 @@ def get_absolute_path(cls, roots: Sequence[str], path: str) -> str: |
1055 | 1056 | log().debug(f"Path {path} served from {abspath}") |
1056 | 1057 | return abspath |
1057 | 1058 |
|
1058 | | - def validate_absolute_path(self, root: str, absolute_path: str) -> str | None: |
| 1059 | + def validate_absolute_path(self, _root: str, absolute_path: str) -> str | None: |
1059 | 1060 | """check if the file should be served (raises 404, 403, etc.)""" |
1060 | 1061 | if not absolute_path: |
1061 | 1062 | raise web.HTTPError(404) |
@@ -1115,7 +1116,7 @@ class FilesRedirectHandler(JupyterHandler): |
1115 | 1116 | """Handler for redirecting relative URLs to the /files/ handler""" |
1116 | 1117 |
|
1117 | 1118 | @staticmethod |
1118 | | - async def redirect_to_files(self: Any, path: str) -> None: |
| 1119 | + async def redirect_to_files(self: Any, path: str) -> None: # noqa: PLW0211 |
1119 | 1120 | """make redirect logic a reusable static method |
1120 | 1121 |
|
1121 | 1122 | so it can be called from other handlers. |
|
0 commit comments