We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04d7e27 commit 72ee030Copy full SHA for 72ee030
twine/commands/upload.py
@@ -149,8 +149,9 @@ def _split_inputs(
149
return Inputs(dists, signatures, attestations_by_dist)
150
151
152
-def _sanitize_url(url) -> str:
153
- """
+def _sanitize_url(url: str) -> str:
+ """Sanitize a URL.
154
+
155
Sanitize URLs, removing any user:password combinations and replacing them with
156
asterisks. Returns the original URL if the string is a non-matching pattern.
157
@@ -160,7 +161,7 @@ def _sanitize_url(url) -> str:
160
161
return:
162
str either sanitized or as entered depending on pattern match.
163
"""
- pattern = "(.*https?://)(\w+:\w+)@(\w+\..*)"
164
+ pattern = r"(.*https?://)(\w+:\w+)@(\w+\..*)"
165
m = re.match(pattern, url)
166
if m:
167
newurl = f"{m.group(1)}*****:*****@{m.group(3)}"
0 commit comments