]> khamidou — GitHub mirrors - imapclient.git/commitdiff
Handle nil internaldate values
authorBen Gotow <bengotow@gmail.com>
Fri, 2 Sep 2016 19:34:45 +0000 (12:34 -0700)
committerBen Gotow <bengotow@gmail.com>
Fri, 2 Sep 2016 19:34:45 +0000 (12:34 -0700)
imapclient/response_parser.py

index a2c2a1f99cdde617239a80791ac1c80e81c70f6b..1b65ad47e95ff82c19a7047d3ef45c66f67bde2e 100644 (file)
@@ -163,6 +163,10 @@ def _int_or_error(value, error_text):
 
 
 def _convert_INTERNALDATE(date_string, normalise_times=True):
+    # Observed in https://sentry.nylas.com/sentry/sync-prod/group/5907/
+    if date_string.upper() == b'NIL':
+        return None
+
     try:
         return parse_to_datetime(date_string, normalise=normalise_times)
     except ValueError: