Message161934
| Author |
vstinner |
| Recipients |
Oleg.Plakhotnyuk, ezio.melotti, giampaolo.rodola, ncoghlan, python-dev, r.david.murray, rhettinger, vstinner |
| Date |
2012年05月30日.08:21:06 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1338366067.85.0.267077086965.issue14796@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> New changeset 98bc9e357f74 by R David Murray in branch 'default':
> #14796: improve calendar test coverage.
> http://hg.python.org/cpython/rev/98bc9e357f74
The following added test fails on Windows:
...
+ def test_yeardatescalendar(self):
+ def shrink(cal):
+ return [[[' '.join((d.strftime('%D')
+ for d in z)) for z in y] for y in x] for x in cal]
self.assertEqual(
- cal.formatyearpage(2004, encoding=encoding).strip(b' \t\n'),
- result_2004_html.strip(' \t\n').encode(encoding)
+ shrink(calendar.Calendar().yeardatescalendar(2004)),
+ result_2004_dates
+ )
...
The "%D" format is not supported by strftime(). Extract of timemodule.c:
#if defined(MS_WINDOWS) && !defined(HAVE_WCSFTIME)
/* check that the format string contains only valid directives */
for(outbuf = strchr(fmt, '%');
outbuf != NULL;
outbuf = strchr(outbuf+2, '%'))
{
if (outbuf[1]=='#')
++outbuf; /* not documented by python, */
if (outbuf[1]=='0円' ||
!strchr("aAbBcdHIjmMpSUwWxXyYzZ%", outbuf[1]))
{
PyErr_SetString(PyExc_ValueError, "Invalid format string");
Py_DECREF(format);
return NULL;
}
}
#endif |
|