Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pgcli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[])
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting comment_tokens=[] disables all comment parsing, so standard pg_service.conf files containing comment lines beginning with '#' (not just at the top) will be treated as invalid entries and may raise ParseError. This is a functional regression versus the previous behavior where '#' comment lines were accepted; consider keeping full-line comment handling while only disabling inline comment stripping (e.g., switch to configparser with inline_comment_prefixes disabled, or configure ConfigObj to not strip inline comments but still ignore full-line comments).

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change alters parsing semantics for pg_service.conf; please add/adjust tests to cover passwords containing '#' and also ensure that comment lines (e.g., lines starting with '#') within/between sections still parse correctly after the change.

Copilot uses AI. Check for mistakes.
except ParseError as err:
err.line_number += skipped_lines
raise err
Expand Down