[ python-Bugs-698706 ] imaplib: parsing INTERNALDATE

SourceForge.net noreply at sourceforge.net
Sat Nov 26 17:33:00 CET 2005


Bugs item #698706, was opened at 2003-03-06 14:45
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=698706&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Konrad Hinsen (hinsen)
Assigned to: Piers Lauder (pierslauder)
Summary: imaplib: parsing INTERNALDATE

Initial Comment:
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.


----------------------------------------------------------------------

>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-11-26 17:32

Message:
Logged In: YES 
user_id=1188172

Already corrected in the 2.5 branch. Corrected in the 2.4
branch in revision 41547.

----------------------------------------------------------------------

Comment By: Facundo Batista (facundobatista)
Date: 2005-01-15 13:41

Message:
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]



----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2004-04-23 03:43

Message:
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'"')

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=698706&group_id=5470


More information about the Python-bugs-list mailing list