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 spaetz
Recipients spaetz
Date 2011-01-27.13:35:00
SpamBayes Score 1.5663718e-06
Marked as misclassified No
Message-id <1296135301.42.0.767818406183.issue11024@psf.upfronthosting.co.za>
In-reply-to
Content
imaplib's Time2Internaldate returns invalid (as localized) INTERNALDATE strings. Appending a message with such a time string leads to a:
19 BAD Command Argument Error. 11 (for MS Exchange IMAP servers)

it returned "26-led-2011 18:23:44 +0100", however:

http://tools.ietf.org/html/rfc2060.html defines:
date_month      ::= "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" /
                    "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec"

so it expects an English date format.

imaplib's Time2Internaldate uses time.strftime() to create the final string which uses the current locale, returning things such as:

"26-led-2011 18:23:44 +0100" rather than "26-Jan-2011 18:23:44 +0100".

For the right thing to do, we would need to set locale.setlocale(locale.LC_TIME, '') to get English formatting or we would need to use some home-grown parser that hardcodes the proper terms.
History
Date User Action Args
2011-01-27 13:35:01spaetzsetrecipients: + spaetz
2011-01-27 13:35:01spaetzsetmessageid: <1296135301.42.0.767818406183.issue11024@psf.upfronthosting.co.za>
2011-01-27 13:35:00spaetzlinkissue11024 messages
2011-01-27 13:35:00spaetzcreate