diff --git a/tornado/httpclient.py b/tornado/httpclient.py index 3011c371b8..afe1da5774 100644 --- a/tornado/httpclient.py +++ b/tornado/httpclient.py @@ -717,7 +717,6 @@ def __init__( self.code = code self.message = message or httputil.responses.get(code, "Unknown") self.response = response - super().__init__(code, message, response) def __str__(self) -> str: return "HTTP %d: %s" % (self.code, self.message) diff --git a/tornado/web.py b/tornado/web.py index 039396470f..cf799d758a 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -1869,7 +1869,7 @@ def log_exception( if isinstance(value, HTTPError): if value.log_message: format = "%d %s: " + value.log_message - args = [value.status_code, self._request_summary()] + list(value.args) + args = [value.status_code, self._request_summary()] + list(value.log_args) gen_log.warning(format, *args) else: app_log.error( @@ -2474,7 +2474,7 @@ def __init__( ) -> None: self.status_code = status_code self.log_message = log_message - self.args = args + self.log_args = args self.reason = kwargs.get("reason", None) if log_message and not args: self.log_message = log_message.replace("%", "%%") @@ -2485,7 +2485,7 @@ def __str__(self) -> str: self.reason or httputil.responses.get(self.status_code, "Unknown"), ) if self.log_message: - return message + " (" + (self.log_message % self.args) + ")" + return message + " (" + (self.log_message % self.log_args) + ")" else: return message