pg.ddx.io  psycopg/psycopg GitHub issues and pull requests  
help / color / mirror / Atom feed
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.py index 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

view thread (5+ messages)  latest in thread

Message-ID: <gh-psycopg-psycopg-1493@github.com>
Permalink:  ../gh-psycopg-psycopg-1493@github.com/

 ·  · 


This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox