I'm not familiar with web.py's sendmail, but you're getting that error because python dictionaries need to be in the format dict(key = value)
your dict(i.my_resume) is missing a key. Are you sure the attachments list you're creating wants a dictionary as a value? I would try attachments = [i.my_resume] maybe? On Tue, May 29, 2012 at 12:48 PM, Leandro Severino <lean...@professionalit.com.br> wrote: > I want send a resume as attachment. > > in my form.html: > > <input id="my_resume" name="my_resume" type="file" /> > > in my controller.py: > > def POST(self): > try: > i = web.input() > web.sendmail('f...@mail.com', 't...@mail.com', 'My subject', > 'my message', attachments=[dict(i.my_resume)]) > raise web.seeother('/thanks') > except Exception: > raise > > when I sent, I receive this error: > > dictionary update sequence element #0 has length 1; 2 is required > > -- > You received this message because you are subscribed to the Google Groups > "web.py" group. > To post to this group, send email to webpy@googlegroups.com. > To unsubscribe from this group, send email to > webpy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/webpy?hl=en. > -- You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to webpy@googlegroups.com. To unsubscribe from this group, send email to webpy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/webpy?hl=en.