File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ Core and Builtins
5858Library
5959-------
6060
61+ - Issue 24244: Prevents termination when an invalid format string is
62+ encountered on Windows in strftime.
63+
6164- Issue #23973: PEP 484: Add the typing module.
6265
6366- Issue #20035: Replaced the ``tkinter._fix`` module used for setting up the
Original file line number Diff line number Diff line change @@ -616,13 +616,6 @@ time_strftime(PyObject *self, PyObject *args)
616616 {
617617 if (outbuf [1 ]== '#' )
618618 ++ outbuf ; /* not documented by python, */
619- if (outbuf [1 ]== '\0' ||
620- !strchr ("aAbBcdHIjmMpSUwWxXyYzZ%" , outbuf [1 ]))
621- {
622- PyErr_SetString (PyExc_ValueError , "Invalid format string" );
623- Py_DECREF (format );
624- return NULL ;
625- }
626619 if ((outbuf [1 ] == 'y' ) && buf .tm_year < 0 )
627620 {
628621 PyErr_SetString (PyExc_ValueError ,
@@ -660,7 +653,9 @@ time_strftime(PyObject *self, PyObject *args)
660653 PyErr_NoMemory ();
661654 break ;
662655 }
656+ _Py_BEGIN_SUPPRESS_IPH
663657 buflen = format_time (outbuf , i , fmt , & buf );
658+ _Py_END_SUPPRESS_IPH
664659#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__ )
665660 err = errno ;
666661#endif
You can’t perform that action at this time.
0 commit comments