# HG changeset patch # User Aurelien Campeas # Date 1605898875 -3600 # Fri Nov 20 20:01:15 2020 +0100 # Node ID 83fb02143b696e72c865feb98b8ff770bd7d9281 # Parent 38c1e6be78d321265c496cbf5c337313d2c4a4d9 client/credentials: remove end of line markers from the git credentials file A spurious \n wont do much good from call sites, where it is not present and we do not want to append such a thing. diff --git a/dulwich/client.py b/dulwich/client.py --- a/dulwich/client.py +++ b/dulwich/client.py @@ -1924,7 +1924,7 @@ try: with open(fname, 'rb') as f: for line in f: - parsed_line = urlparse(line) + parsed_line = urlparse(line.strip()) if (parsed_line.scheme == scheme and parsed_line.hostname == hostname and (username is None or diff --git a/dulwich/tests/test_client.py b/dulwich/tests/test_client.py --- a/dulwich/tests/test_client.py +++ b/dulwich/tests/test_client.py @@ -1336,7 +1336,7 @@ @classmethod def setUpClass(cls): with tempfile.NamedTemporaryFile(delete=False) as f: - f.write(b'https://user:pass@example.org') + f.write(b'https://user:pass@example.org\n') cls.fname = f.name @classmethod