Message92418
Here's a patch to normalize the results of the various system calls
which return time information. This was against the source for Python 2.5.1.
*** timemodule.c Tue Sep 8 10:28:31 2009
--- /home/rshapiro/216/redist/Python-2.5.1/Modules/timemodule.c.dist Mon
Jan 12 22:53:07 2009
***************
*** 241,247 ****
static PyObject *
tmtotuple(struct tm *p)
{
- long dstval;
PyObject *v = PyStructSequence_New(&StructTimeType);
if (v == NULL)
return NULL;
--- 241,246 ----
***************
*** 256,271 ****
SET(5, p->tm_sec);
SET(6, (p->tm_wday + 6) % 7); /* Want Monday == 0 */
SET(7, p->tm_yday + 1); /* Want January, 1 == 1 */
! /* Alas, on some platforms tm_isdst can be something other
than -1, 0, or 1 */
! if (p->tm_isdst < 0) {
! dstval = -1;
! } else if (p->tm_isdst > 0) {
! dstval = 1;
! } else {
! dstval = 0;
! }
!
! SET(8, dstval);
#undef SET
if (PyErr_Occurred()) {
Py_XDECREF(v);
--- 255,261 ----
SET(5, p->tm_sec);
SET(6, (p->tm_wday + 6) % 7); /* Want Monday == 0 */
SET(7, p->tm_yday + 1); /* Want January, 1 == 1 */
! SET(8, p->tm_isdst);
#undef SET
if (PyErr_Occurred()) {
Py_XDECREF(v);
(t)neo:/home/rshapiro/216/redist/patch/Python-2.5.1/Modules 140 % |
|
Date |
User |
Action |
Args |
2009-09-08 14:43:06 | rshapiro | set | recipients:
+ rshapiro, brett.cannon, georg.brandl |
2009-09-08 14:43:05 | rshapiro | set | messageid: <1252420985.69.0.912324758726.issue6823@psf.upfronthosting.co.za> |
2009-09-08 14:43:04 | rshapiro | link | issue6823 messages |
2009-09-08 14:43:03 | rshapiro | create | |
|