[Python-bugs-list] [ python-Bugs-588202 ] MIMEBase as_string fails with 1 attchmnt

noreply@sourceforge.net noreply@sourceforge.net
Mon, 29 Jul 2002 12:19:52 -0700


Bugs item #588202, was opened at 2002-07-29 14:19
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=588202&group_id=5470

Category: Python Library
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Moshe Yudkowsky (myudkowsky)
Assigned to: Nobody/Anonymous (nobody)
Summary: MIMEBase as_string fails with 1 attchmnt

Initial Comment:
I get an exception when I create a multipart MIMEBase
message: if the number of attachments is less than 2,
Generator.py throws an exception.

Procedule:

1. import email.MIMEBase, email.MIMEText

2. create instance of MIMEText, e.g.,

t=email.MIMEText.MIMEText("some data")

3. t.as_string() prints out text

4. Create an instance of MIMEBase -- let's use:

b=MIMEBase('multipart','mixed')

5. b.as_string() throws an exception in Generator.py

6. add preamble, epilogue -- it still fails

7. attach something to the MIMEBase instance:

b.attach(t)

8. b.as_string() still fails, this time throwing an
exception in Message.py.

9. Attach a second attachment:

b.attach(t)

(same atttachment twice will do)

10. b.as_string() works

I regret that this time I do not have a proposed fix,
as I had a little trouble deciphering the traceback and
time pressure prevents me from running the debugger
just now. If need be I expect you can assign this to me
to find a fix.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=588202&group_id=5470