]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
fix(c): fix incomplete error message for timestamp too small
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 15 Mar 2023 03:24:39 +0000 (04:24 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 15 Mar 2023 03:25:16 +0000 (04:25 +0100)
Close #521.

psycopg_c/psycopg_c/types/datetime.pyx

index 51e7dcf9be6d2239efd4143a82c42908b72cc898..3b6fd1f18406b35faa53336efb00b0f150894909 100644 (file)
@@ -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: