Skip to content

Commit 480d466

Browse files
authored
Merge branch 'main' into version-1.32.0
2 parents 1bac023 + 70fd4f6 commit 480d466

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

ada_url/ada_adapter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ def __str__(self):
272272

273273
def __repr__(self):
274274
duplicate = deepcopy(self)
275-
duplicate.password = ''
275+
if duplicate.password:
276+
duplicate.password = ''
276277
return f'<URL "{duplicate.href}">'
277278

278279
@staticmethod

tests/test_ada_url.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ def test_to_repr_password(self):
203203
str(urlobj), 'https://user:password1@example.org/something.txt'
204204
)
205205

206+
def test_repr_file(self):
207+
url = URL('file:///')
208+
repr(url)
209+
206210
def test_check_url(self):
207211
for s, expected in (
208212
('https:example.org', True),

0 commit comments

Comments
 (0)