Timestamp parsing error #23

Closed
kdeldycke opened this Issue Mar 20, 2013 · 1 comment

Projects

None yet

2 participants

@kdeldycke
Owner

Here is an error reported by mail by a user:

root@cub:/etc/getmail# /usr/bin/deldupmail.py -d /var/vmail/www.example.com/admin/Maildir/
Processing 64300 mails in /var/vmail/www.example.com/admin/Maildir
...........................................................................
Traceback (most recent call last):
  File "/usr/bin/deldupmail.py", line 468, in <module>
    main()
  File "/usr/bin/deldupmail.py", line 422, in main
    duplicates_run(opts, maildir_paths)
  File "/usr/bin/deldupmail.py", line 443, in duplicates_run
    mail_count += collate_folder_by_hash(mails_by_hash, maildir, opts.message_id)
  File "/usr/bin/deldupmail.py", line 263, in collate_folder_by_hash
    mail_hash, header_text = compute_hash_key(message, use_message_id)
  File "/usr/bin/deldupmail.py", line 249, in compute_hash_key
    canonical_headers_text = get_canonical_headers(message)
  File "/usr/bin/deldupmail.py", line 187, in get_canonical_headers
    canonical_value = get_canonical_header_value(header, value)
  File "/usr/bin/deldupmail.py", line 223, in get_canonical_header_value
    utc_timestamp = email.utils.mktime_tz(email.utils.parsedate_tz(value))
  File "/usr/lib/python2.7/email/_parseaddr.py", line 154, in mktime_tz
    if data[9] is None:
TypeError: 'NoneType' object has no attribute '__getitem__'
root@cub:/etc/getmail#
@aspiers
Contributor
aspiers commented Mar 21, 2013

Thanks @kdeldycke for submitting this on behalf of Bilgin.

Bilgin, the line numbers in this stack trace show that you are using an out of date or modified version of the code. Please use the latest version from git and reopen the issue if you still see the problem. The trace suggests that this is an issue during parsing of the Date: header, but I will only support code from the tip of git's master branch.

Kevin, I recommend you close this issue now.

@aspiers aspiers pushed a commit to aspiers/scripts that referenced this issue Mar 21, 2013
Adam Spiers gracefully handle non-parseable dates (fixes #23) a2bc66e
@kdeldycke kdeldycke closed this Mar 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment