diff --git a/asyncpg/connect_utils.py b/asyncpg/connect_utils.py index e215391b..092723a7 100644 --- a/asyncpg/connect_utils.py +++ b/asyncpg/connect_utils.py @@ -453,7 +453,7 @@ def _parse_connect_dsn_and_args(*, dsn, host, port, user, server_settings = {**query, **server_settings} if connection_service_file is not None and service is not None: - pg_service = configparser.ConfigParser() + pg_service = configparser.ConfigParser(interpolation=None) pg_service.read(connection_service_file) if service in pg_service.sections(): service_params = pg_service[service] diff --git a/tests/test_connect.py b/tests/test_connect.py index 1c25d8d6..6aa34fb9 100644 --- a/tests/test_connect.py +++ b/tests/test_connect.py @@ -1286,7 +1286,7 @@ def test_connect_connection_service_file(self): host=somehost database=test_dbname user=admin -password=test_password +password=test%password target_session_attrs=primary krbsrvname=fakekrbsrvname gsslib=sspi @@ -1322,7 +1322,7 @@ def test_connect_connection_service_file(self): [('somehost', 5433)], { 'user': 'admin', - 'password': 'test_password', + 'password': 'test%password', 'database': 'test_dbname', 'target_session_attrs': 'primary', 'krbsrvname': 'fakekrbsrvname',