Skip to content

Commit f7c0dd1

Browse files
Add \!r to error message for improved clarity on file paths
1 parent ed0b1b5 commit f7c0dd1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/requests/adapters.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def cert_verify(self, conn, url, verify, cert):
327327
if not os.path.exists(cert_loc):
328328
raise OSError(
329329
f"Could not find a suitable TLS CA certificate bundle, "
330-
f"invalid path: {cert_loc}"
330+
f"invalid path: {cert_loc!r}"
331331
)
332332

333333
if not os.path.isdir(cert_loc):
@@ -349,11 +349,11 @@ def cert_verify(self, conn, url, verify, cert):
349349
if conn.cert_file and not os.path.exists(conn.cert_file):
350350
raise OSError(
351351
f"Could not find the TLS certificate file, "
352-
f"invalid path: {conn.cert_file}"
352+
f"invalid path: {conn.cert_file!r}"
353353
)
354354
if conn.key_file and not os.path.exists(conn.key_file):
355355
raise OSError(
356-
f"Could not find the TLS key file, invalid path: {conn.key_file}"
356+
f"Could not find the TLS key file, invalid path: {conn.key_file!r}"
357357
)
358358

359359
def build_response(self, req, resp):

0 commit comments

Comments
 (0)