def parse_rfc2822_date(s):
 date_tuple = parsedate(s)
 if (date_tuple is None):
  return None
 return datetime.datetime(*date_tuple[:6])

def parse_rfc2822_date ( s ) : date_tuple = parsedate ( s ) if ( date_tuple is None ) : return None return datetime . datetime ( * date_tuple [ : 6 ] )
parses an rfc 2822 date string and returns a time zone naive datetime object .