We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1aefd9b commit 69116b6Copy full SHA for 69116b6
2 files changed
ada_url/ada_adapter.py
@@ -273,7 +273,8 @@ def __str__(self):
273
274
def __repr__(self):
275
duplicate = deepcopy(self)
276
- duplicate.password = ''
+ if duplicate.password:
277
+ duplicate.password = ''
278
return f'<URL "{duplicate.href}">'
279
280
@staticmethod
tests/test_ada_url.py
@@ -203,6 +203,10 @@ def test_to_repr_password(self):
203
str(urlobj), 'https://user:password1@example.org/something.txt'
204
)
205
206
+ def test_repr_file(self):
207
+ url = URL('file:///')
208
+ repr(url)
209
+
210
def test_check_url(self):
211
for s, expected in (
212
('https:example.org', True),
0 commit comments