From: Daniele Varrazzo Date: Wed, 15 Mar 2023 03:24:39 +0000 (+0100) Subject: fix(c): fix incomplete error message for timestamp too small X-Git-Tag: pool-3.1.7~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1320c58f88c01b4707a2e906e26d32ef7016d01e;p=thirdparty%2Fpsycopg.git fix(c): fix incomplete error message for timestamp too small Close #521. --- diff --git a/psycopg_c/psycopg_c/types/datetime.pyx b/psycopg_c/psycopg_c/types/datetime.pyx index 51e7dcf9b..3b6fd1f18 100644 --- a/psycopg_c/psycopg_c/types/datetime.pyx +++ b/psycopg_c/psycopg_c/types/datetime.pyx @@ -1073,7 +1073,7 @@ cdef object _get_timestamp_load_error( return len(s.split()[-1]) > 4 # year is last token if s == "-infinity" or s.endswith("BC"): - return e.DataError("timestamp too small (before year 1): {s!r}") + return e.DataError(f"timestamp too small (before year 1): {s!r}") elif s == "infinity" or is_overflow(s): return e.DataError(f"timestamp too large (after year 10K): {s!r}") else: