diff options
author | Aurélien Bompard <aurelien@bompard.org> | 2012-11-16 15:21:52 +0100 |
---|---|---|
committer | Aurélien Bompard <aurelien@bompard.org> | 2012-11-16 15:21:56 +0100 |
commit | 8666f5d37daf5789300f944fe7445db16d575822 (patch) | |
tree | 190a2e90317d559137bd18b9cc5ef7167818642b /kittystore | |
parent | f94b9fe4a02543b402e8495bf645d36a60554c22 (diff) | |
download | kittystore-8666f5d37daf5789300f944fe7445db16d575822.tar.gz kittystore-8666f5d37daf5789300f944fe7445db16d575822.tar.xz kittystore-8666f5d37daf5789300f944fe7445db16d575822.zip |
Handle a missing subject header
Diffstat (limited to 'kittystore')
-rw-r--r-- | kittystore/import.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kittystore/import.py b/kittystore/import.py index 71e933f..29a0b7a 100644 --- a/kittystore/import.py +++ b/kittystore/import.py @@ -117,8 +117,9 @@ class DbImporter(object): cnt_read = cnt_read + 1 self.total_imported += 1 # Un-wrap the subject line if necessary - message.replace_header("subject", - TEXTWRAP_RE.sub(" ", message["subject"])) + if message["subject"]: + message.replace_header("subject", + TEXTWRAP_RE.sub(" ", message["subject"])) # Try to find the mailing-list subject prefix in the first email if cnt_read == 1: subject_prefix = PREFIX_RE.search(message["subject"]) |