Skip to content

Commit b458254

Browse files
committed
Use requests_toolbelt to log request/response
1 parent 2cf7138 commit b458254

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

twine/commands/upload.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from typing import Dict, List, cast
1919

2020
import requests
21+
from requests_toolbelt.utils import dump
2122

2223
from twine import commands
2324
from twine import exceptions
@@ -141,11 +142,7 @@ def upload(upload_settings: settings.Settings, dists: List[str]) -> None:
141142
resp = repository.upload(package)
142143

143144
if upload_settings.verbose:
144-
logger.info(
145-
f"Received {resp.status_code} response from {resp.url}: {resp.reason}"
146-
)
147-
if resp.text:
148-
logger.info(f"Response text:\n{resp.text}")
145+
logger.info(dump.dump_all(resp).decode("utf-8"))
149146

150147
# Bug 92. If we get a redirect we should abort because something seems
151148
# funky. The behaviour is not well defined and redirects being issued

0 commit comments

Comments
 (0)