Update of /cvsroot/pywin32/pywin32/win32/src
In directory vz-cvs-2.sog:/tmp/cvs-serv17897/win32/src
Modified Files:
PyTime.cpp
Log Message:
don't call strftime with negative dates to prevent crt crashes
Index: PyTime.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyTime.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** PyTime.cpp 16 Nov 2010 04:45:52 -0000 1.30
--- PyTime.cpp 27 Feb 2011 05:35:46 -0000 1.31
***************
*** 167,174 ****
PyTime *pTime = (PyTime *)self;
SYSTEMTIME st;
! if ( !VariantTimeToSystemTime(pTime->m_time, &st) )
{
! PyErr_SetString(PyExc_ValueError, "illegal internal value");
return NULL;
}
--- 167,176 ----
PyTime *pTime = (PyTime *)self;
+ // _tcsftime tries to be "helpful" by dieing with a too early date in
+ // some CRT implementations (eg, vs2008 64bit - and probably others)
SYSTEMTIME st;
! if ( !VariantTimeToSystemTime(pTime->m_time, &st) || st.wYear < 1900 )
{
! PyErr_SetString(PyExc_ValueError, "can't format dates this early");
return NULL;
}
|