diff --git a/asyncpg/connect_utils.py b/asyncpg/connect_utils.py index 07c4fdde..4c996fad 100644 --- a/asyncpg/connect_utils.py +++ b/asyncpg/connect_utils.py @@ -123,10 +123,15 @@ def _read_password_file(passfile: pathlib.Path) \ continue # Backslash escapes both itself and the colon, # which is a record separator. + # First, temporarily replace \\ with a placeholder line = line.replace(R'\\', '\n') + # Split on unescaped colons + parts = re.split(r'(?