From: Hisernberg (@Hisernberg) <noreply+Hisernberg@github.com>
To: psycopg/psycopg <noreply+psycopg-psycopg@github.com>
Subject: [psycopg/psycopg] PR #1493: Fix missing f-string in update_error_prefixes.py error message
Date: Wed, 11 Nov 2026 13:37:43 +0000
Message-ID: <gh-psycopg-psycopg-1493@github.com> (raw)
#### Description
One-line fix in `tools/update_error_prefixes.py`: the `parser.error(...)` message printed the literal text `not a valid directory: {opt.pgroot}` instead of the actual path, because the string was missing the `f` prefix.
Before/after (verified locally):
```
before: not a valid directory: {opt.pgroot}
after : not a valid directory: /nonexistent/path
```
#### AI Generation Disclosure
Developed with AI assistance (agent workflow): found by an AST scan for plain strings containing `{name}` where `name` is a live local variable; verified with the before/after evaluation above and `py_compile`.
inline patch 1: tools/update_error_prefixes.py (+1/-1 lines) download inline-1.patchdiff --git a/tools/update_error_prefixes.py b/tools/update_error_prefixes.pyindex fe86eb7c2..c079a867e 100755--- a/tools/update_error_prefixes.py+++ b/tools/update_error_prefixes.py@@ -91,7 +91,7 @@ def parse_cmdline() -> Namespace:
)
if not (opt := parser.parse_args()).pgroot.is_dir():
- parser.error("not a valid directory: {opt.pgroot}")+ parser.error(f"not a valid directory: {opt.pgroot}")
return opt