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
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
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
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
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