From f7c0dd1c1212de1ce4c3a0ac61f4dfd5a0b1f59f Mon Sep 17 00:00:00 2001 From: jjkochan-metro Date: Tue, 29 Oct 2024 15:25:24 -0500 Subject: [PATCH] Add \!r to error message for improved clarity on file paths --- src/requests/adapters.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/requests/adapters.py b/src/requests/adapters.py index 9a58b16025..6142fc40f3 100644 --- a/src/requests/adapters.py +++ b/src/requests/adapters.py @@ -327,7 +327,7 @@ def cert_verify(self, conn, url, verify, cert): if not os.path.exists(cert_loc): raise OSError( f"Could not find a suitable TLS CA certificate bundle, " - f"invalid path: {cert_loc}" + f"invalid path: {cert_loc!r}" ) if not os.path.isdir(cert_loc): @@ -349,11 +349,11 @@ def cert_verify(self, conn, url, verify, cert): if conn.cert_file and not os.path.exists(conn.cert_file): raise OSError( f"Could not find the TLS certificate file, " - f"invalid path: {conn.cert_file}" + f"invalid path: {conn.cert_file!r}" ) if conn.key_file and not os.path.exists(conn.key_file): raise OSError( - f"Could not find the TLS key file, invalid path: {conn.key_file}" + f"Could not find the TLS key file, invalid path: {conn.key_file!r}" ) def build_response(self, req, resp):