From e03ba80ce7b3933c70abd8893ee9dbc30d55e77e Mon Sep 17 00:00:00 2001 From: bobo-xxx <111567133+bobo-xxx@users.noreply.github.com> Date: Sat, 18 Apr 2026 16:53:48 +0800 Subject: [PATCH] fix: preserve hash character in pg_service.conf passwords The # character was being treated as a comment delimiter by ConfigObj, truncating passwords like abc#123 to abc. Added comment_tokens=[] to disable this behavior. Fixes #1575 --- pgcli/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgcli/main.py b/pgcli/main.py index d49c86a66..c53d60b04 100644 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -1974,7 +1974,7 @@ def parse_service_info(service): with open(service_file, newline="") as f: skipped_lines = skip_initial_comment(f) try: - service_file_config = ConfigObj(f) + service_file_config = ConfigObj(f, comment_tokens=[]) except ParseError as err: err.line_number += skipped_lines raise err