diff --git a/Changelog.draft.rst b/Changelog.draft.rst index cd306d2..ed3a14e 100644 --- a/Changelog.draft.rst +++ b/Changelog.draft.rst @@ -21,6 +21,7 @@ Changes slight speedup. * No whitespace is stripped from comma-separated arguments passed via the -f option. +* Give more detailed error when encountering a corrupt UID mapping file. Bug Fixes --------- diff --git a/offlineimap/folder/UIDMaps.py b/offlineimap/folder/UIDMaps.py index bd0f43a..76c5ee4 100644 --- a/offlineimap/folder/UIDMaps.py +++ b/offlineimap/folder/UIDMaps.py @@ -51,7 +51,11 @@ class MappingFolderMixIn: line = file.readline() if not len(line): break - line = line.strip() + try: + line = line.strip() + except ValueError: + raise Exception("Corrupt line '%s' in UID mapping file '%s'" \ + %(line, mapfilename)) (str1, str2) = line.split(':') loc = long(str1) rem = long(str2)