diff --git a/ada_url/ada_adapter.py b/ada_url/ada_adapter.py index 0d62059..21078d6 100644 --- a/ada_url/ada_adapter.py +++ b/ada_url/ada_adapter.py @@ -273,7 +273,8 @@ def __str__(self): def __repr__(self): duplicate = deepcopy(self) - duplicate.password = '' + if duplicate.password: + duplicate.password = '' return f'' @staticmethod diff --git a/pyproject.toml b/pyproject.toml index 02d9b0f..4f1ef4d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "ada-url" -version = "1.31.0" +version = "1.31.1" authors = [ {name = "Bo Bayles", email = "bo@bbayles.com"}, ] diff --git a/tests/test_ada_url.py b/tests/test_ada_url.py index ce82a97..57a6baf 100644 --- a/tests/test_ada_url.py +++ b/tests/test_ada_url.py @@ -203,6 +203,10 @@ def test_to_repr_password(self): str(urlobj), 'https://user:password1@example.org/something.txt' ) + def test_repr_file(self): + url = URL('file:///') + repr(url) + def test_check_url(self): for s, expected in ( ('https:example.org', True),