Message122675
Can you try this diff and see if it solves the problem:
Index: Modules/timemodule.c
===================================================================
--- Modules/timemodule.c (revision 86848)
+++ Modules/timemodule.c (working copy)
@@ -639,6 +639,7 @@
PyObject *ot = NULL;
time_t tt;
char *p;
+ Py_ssize_t len;
if (!PyArg_UnpackTuple(args, "ctime", 0, 1, &ot))
return NULL;
@@ -657,8 +658,10 @@
PyErr_SetString(PyExc_ValueError, "unconvertible time");
return NULL;
}
- if (p[24] == '\n')
- p[24] = '\0';
+ len = strlen(p);
+ if (len > 0 && p[len-1] == '\n')
+ /* Remove the trailing newline, if present. */
+ p[len-1] = '\0';
return PyUnicode_FromString(p);
} |
|
Date |
User |
Action |
Args |
2010-11-28 16:17:34 | eric.smith | set | recipients:
+ eric.smith, Gerrit.Holl |
2010-11-28 16:17:34 | eric.smith | set | messageid: <1290961054.88.0.0564889572506.issue10563@psf.upfronthosting.co.za> |
2010-11-28 16:17:31 | eric.smith | link | issue10563 messages |
2010-11-28 16:17:31 | eric.smith | create | |
|