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.

classification
Title: imaplib: parsing INTERNALDATE
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pierslauder Nosy List: anadelonbrin, facundobatista, georg.brandl, hinsen, pierslauder
Priority: normal Keywords:

Created on 2003-03-06 13:45 by hinsen, last changed 2022-04-10 16:07 by admin. This issue is now closed.

Messages (4)
msg14997 - (view) Author: Konrad Hinsen (hinsen) Date: 2003-03-06 13:45
The regular expression InternalDate in imaplib does not 
match dates in which the day number is two-digit with a 
leading zero.

From a cursory glance at the IMAP definition, this is a 
legal format, and there is at least one IMAP server that 
uses it (courier-imap).

The attached patch is for Python 2.2.2, but the problem still 
exists in 2.3a2.
msg14998 - (view) Author: Tony Meyer (anadelonbrin) Date: 2004-04-23 01:43
Logged In: YES 
user_id=552329

This is correct, RFC 2060 allows for the date to be
"2digit", where digit includes 0.  There is no attached
patch, but I can't attach to this tracker, so I'm putting it
here in the comment (it's a one character change).  This
still exists in 2004-04-23 anon cvs.

*** imaplib.py  Fri Apr 23 13:40:32 2004
--- imaplib-fixed.py    Fri Apr 23 13:42:31 2004
***************
*** 79,85 ****
  Continuation = re.compile(r'\+( (?P<data>.*))?')
  Flags = re.compile(r'.*FLAGS \((?P<flags>[^\)]*)\)')
  InternalDate = re.compile(r'.*INTERNALDATE "'
!         r'(?P<day>[
123][0-9])-(?P<mon>[A-Z][a-z][a-z])-(?P<year>[0-9][0-9][0-
9][0-9])'
          r'
(?P<hour>[0-9][0-9]):(?P<min>[0-9][0-9]):(?P<sec>[0-9][0-9])'
          r'
(?P<zonen>[-+])(?P<zoneh>[0-9][0-9])(?P<zonem>[0-9][0-9])'
          r'"')
--- 79,85 ----
  Continuation = re.compile(r'\+( (?P<data>.*))?')
  Flags = re.compile(r'.*FLAGS \((?P<flags>[^\)]*)\)')
  InternalDate = re.compile(r'.*INTERNALDATE "'
!         r'(?P<day>[
0123][0-9])-(?P<mon>[A-Z][a-z][a-z])-(?P<year>[0-9][0-9][0
-9][0-9])'
          r'
(?P<hour>[0-9][0-9]):(?P<min>[0-9][0-9]):(?P<sec>[0-9][0-9])'
          r'
(?P<zonen>[-+])(?P<zoneh>[0-9][0-9])(?P<zonem>[0-9][0-9])'
          r'"')
msg14999 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2005-01-15 12:41
Logged In: YES 
user_id=752496

This patch is not yet applied in CVS.

Piers, I assign this to you because you know the module, but
the patch is pretty simple, it's just adding a 0 to a part
of the InternalDate's re:

From: (?P<day>[ 123]
To: (?P<day>[ 0123]

msg15000 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-11-26 16:32
Logged In: YES 
user_id=1188172

Already corrected in the 2.5 branch. Corrected in the 2.4
branch in revision 41547.
History
Date User Action Args
2022-04-10 16:07:26adminsetgithub: 38115
2003-03-06 13:45:38hinsencreate