Parsing email attachments: get_payload() produces unsaveable data

Albert Hopkins marduk at
Sun Oct 4 23:03:39 CEST 2009

On Sun, 2009-10-04 at 09:17 -0700, dpapathanasiou wrote:
> > Which is *really* difficult (for me) to read.  Any chance of providing a
> > "normal" traceback?
>   File "/opt/server/smtp/", line 213, in handle
>     email_replier.post_reply(recipient_mbox, ''.join(data))
>   File "/opt/server/smtp/", line 108, in post_reply
>     save_attachments(result[2], msg_text)
>   File "/opt/server/smtp/", line 79, in
> save_attachments
>     data_manager.upload_file(item_id, filename, filedata)
>   File "../db/", line 697, in upload_file
>     if docs_db.save_file(item_id, file_name, file_data):
>   File "../db/", line 102, in save_file
>     result = file_utils.write_file(saved_file_path, saved_file_name +
> saved_file_ext, file_data)
> AttributeError

Are you sure this is the complete traceback?  Usually an AttributeError
returns a text message such as:

   AttributeError: foo has no such attribute bar

Also, the traceback says the exception happened in "save_file", but the
code you posted was a function called "save_attachments" and the
function call is different.

Would be nice if we could get the full traceback with the exact matching
code.  Otherwise we have to make guesses.  But I've given up. Perhaps
someone else is better off helping you.


More information about the Python-list mailing list