Skip to content

Commit a7cf1b3

Browse files
committed
Debug
1 parent 4615f6d commit a7cf1b3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Modules/timemodule.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,9 @@ time_strftime1(time_char **outbuf, size_t *bufsize,
813813
/* I hate these functions that presume you know how big the output
814814
* will be ahead of time...
815815
*/
816+
int attempts = 0;
816817
while (1) {
818+
attempts ++;
817819
if (*bufsize > PY_SSIZE_T_MAX/sizeof(time_char)) {
818820
PyErr_NoMemory();
819821
return NULL;
@@ -854,7 +856,7 @@ time_strftime1(time_char **outbuf, size_t *bufsize,
854856
format string. For instance we end up here with musl if the format
855857
string ends with a '%'.
856858
*/
857-
PyErr_SetString(PyExc_ValueError, "Invalid format string");
859+
PyErr_Format(PyExc_ValueError, "Invalid format string attempts: %d *outbuf: '%.8s'", attempts, *outbuf);
858860
return NULL;
859861
}
860862
}

0 commit comments

Comments
 (0)