[issue11024] imaplib: Time2Internaldate() returns localized strings

2011-01-27 Thread Sebastian Spaeth
New submission from Sebastian Spaeth : 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

[issue11024] imaplib: Time2Internaldate() returns localized strings

2011-01-27 Thread Sebastian Spaeth
Sebastian Spaeth added the comment: P.S. To replicate this in ipython: import locale, imaplib locale.setlocale(locale.LC_ALL,'de_CH.utf8') imaplib.Time2Internaldate(220254431) Out[1]: '"24-Dez-1976 06:47:11 +0100"' (Note the

[issue11024] imaplib: Time2Internaldate() returns localized strings

2011-01-27 Thread Sebastian Spaeth
Sebastian Spaeth added the comment: CC'ing lavajoe as he seemed to be busy with some of imaplib's Date stuff the last couple of days. -- nosy: +lavajoe ___ Python tracker <http://bugs.python.o

[issue11024] imaplib: Time2Internaldate() returns localized strings

2011-01-27 Thread Sebastian Spaeth
Sebastian Spaeth added the comment: I think I found the issue he mentioned, however it was about the functions taking the local time (rather than UTC), which is fine. The problem is that Time2Internaldate is used for every .append() operation internally, producing invalid dates which are

[issue11024] imaplib: Time2Internaldate() returns localized strings

2011-01-28 Thread Sebastian Spaeth
Sebastian Spaeth added the comment: > Added file: imaplib_Time2Internaldate_locale_fix.patch The patch looks very good to me and works. I agree that we should be returning a bytearray but this is should not be part of this issue. For all that it's worth: Signed-off-by: Sebastia