This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gregory.p.smith
Recipients gregory.p.smith, mishok13, sbj3, shura_zam
Date 2008-05-25.08:54:43
SpamBayes Score 2.3873135e-05
Marked as misclassified No
Message-id <1211705687.38.0.85807015749.issue2782@psf.upfronthosting.co.za>
In-reply-to
Content
Yes, sounds like a bug.  I'll fix it.

But should time.strftime allow a unicode format string as input in the
first place?  For backwards compatibility I'd say yes.  But.. Sane
output can not be guaranteed from time.strftime when given a unicode
format string if it contains multibyte characters that happen to have a
valid (bytewise) % format code in them within a multibyte character. 
Anyways the output is always byte string without a specified encoding so
giving it actual unicode characters as input is not advised (at least in
2.6, i didn't check 3.0).

there's an amusing comment in Modules/datetimemodule.c:

/* I sure don't want to reproduce the strftime code from the time module,
 * so this imports the module and calls it.  All the hair is due to
 * giving special meanings to the %z, %Z and %f format codes via a
 * preprocessing step on the format string.
...
*/
static PyObject * wrap_strftime(
History
Date User Action Args
2008-05-25 08:54:48gregory.p.smithsetspambayes_score: 2.38731e-05 -> 2.3873135e-05
recipients: + gregory.p.smith, shura_zam, mishok13, sbj3
2008-05-25 08:54:47gregory.p.smithsetspambayes_score: 2.38731e-05 -> 2.38731e-05
messageid: <1211705687.38.0.85807015749.issue2782@psf.upfronthosting.co.za>
2008-05-25 08:54:45gregory.p.smithlinkissue2782 messages
2008-05-25 08:54:44gregory.p.smithcreate