changeset: 98174:aa6b9205c120 branch: 3.5 user: Steve Dower date: Tue Sep 22 14:51:42 2015 -0700 files: Misc/NEWS Modules/timemodule.c description: Issue #25092: Fix datetime.strftime() failure when errno was already set to EINVAL. diff -r b7f0f1d1e923 -r aa6b9205c120 Misc/NEWS --- a/Misc/NEWS Tue Sep 22 14:33:31 2015 -0700 +++ b/Misc/NEWS Tue Sep 22 14:51:42 2015 -0700 @@ -18,6 +18,9 @@ Library ------- +- Issue #25092: Fix datetime.strftime() failure when errno was already set to + EINVAL. + - Issue #23517: Fix rounding in fromtimestamp() and utcfromtimestamp() methods of datetime.datetime: microseconds are now rounded to nearest with ties going to nearest even integer (ROUND_HALF_EVEN), instead of being rounding diff -r b7f0f1d1e923 -r aa6b9205c120 Modules/timemodule.c --- a/Modules/timemodule.c Tue Sep 22 14:33:31 2015 -0700 +++ b/Modules/timemodule.c Tue Sep 22 14:51:42 2015 -0700 @@ -653,6 +653,9 @@ PyErr_NoMemory(); break; } +#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__) + errno = 0; +#endif _Py_BEGIN_SUPPRESS_IPH buflen = format_time(outbuf, i, fmt, &buf); _Py_END_SUPPRESS_IPH