The request for a Windows installer for Python 2.6 stalled
for reasons unstated:
http://sourceforge.net/tracker/?func=detail&aid=2346434&group_id=55673&atid=477848
Perhaps the fix proposed below addresses the problem?
Alan Isaac
-------- Original Message --------
Date: Tue, 30 Jun 2009 16:44:53 -0600
From: Anthony Tuininga <ant...@gm...>
Ok, I tracked down the problem. I ran into this myself with cx_Oracle
if I remember correctly so it didn't take too long. :-)
The problem is that Python 2.6 uses the new C library that comes with
Visual Studio 2008. Microsoft has seen fit to eliminate a number of
standard C routines. In my case I found equivalent routines in Python
so I could avoid using them. In your case I'm not sure what you are
going to want to do. Its only inside a debugging function so you can
probably quite safely turn it off completely but I'll leave that to
you to decide. If you want further help with this, let me know. I can
also provide you with the equivalent code for Windows that I use in
cx_Logging.
The offending lines are (in the 2.1.1a1 release)
stt/TextTools/mxTextTools/mxstdlib.h (lines 157 and 187-189)
If you comment out these lines the problem goes away completely.
This is the code I use in cx_Logging. The 'd' part is for the date and
the else part is for the time. If you have questions, fire away. :-)
#define DATE_FORMAT "%.4d/%.2d/%.2d"
#define TIME_FORMAT "%.2d:%.2d:%.2d.%.3d"
#if defined MS_WINDOWS
GetLocalTime(&time);
#else
gettimeofday(&timeOfDay, NULL);
localtime_r(&timeOfDay.tv_sec, &time);
#endif
}
#ifdef MS_WINDOWS
if (*ptr == 'd')
sprintf(temp, DATE_FORMAT, time.wYear, time.wMonth,
time.wDay);
else
sprintf(temp, TIME_FORMAT, time.wHour, time.wMinute,
time.wSecond, time.wMilliseconds);
#else
if (*ptr == 'd')
sprintf(temp, DATE_FORMAT, time.tm_year + 1900,
time.tm_mon + 1, time.tm_mday);
else
sprintf(temp, TIME_FORMAT, time.tm_hour, time.tm_min,
time.tm_sec, (int) (timeOfDay.tv_usec / 1000));
#endif
|