[Python-bugs-list] [ python-Bugs-531966 ] email: problems generating multipart msg

noreply@sourceforge.net noreply@sourceforge.net
Fri, 22 Mar 2002 08:31:42 -0800


Bugs item #531966, was opened at 2002-03-19 13:06
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=531966&group_id=5470

Category: Python Library
>Group: Python 2.2.1 candidate
>Status: Closed
Resolution: None
Priority: 5
Submitted By: A.M. Kuchling (akuchling)
Assigned to: Barry Warsaw (bwarsaw)
Summary: email: problems generating multipart msg

Initial Comment:
As reported in comp.lang.python, the example program 
given in Doc/lib/email.tex to wrap up a whole 
directory as a MIME message doesn't work if the 
directory is empty or contains only a single file.

As that script is fairly long, I've attached a 
shorter example script which also demonstrates the 
bug; coincidentally, I hit it yesterday at work.
The script crashes with:

  File 
"/data/python2/dist/src/Lib/email/Generator.py", line 
236, in _handle_multipart
    for part in msg.get_payload():
  File "/data/python2/dist/src/Lib/email/Message.py", 
line 152, in __getitem__
    return self.get(name)
  File "/data/python2/dist/src/Lib/email/Message.py", 
line 215, in get
    name = name.lower()
AttributeError: 'int' object has no attribute 'lower'



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

>Comment By: Barry Warsaw (bwarsaw)
Date: 2002-03-22 11:31

Message:
Logged In: YES 
user_id=12800

Fixed in Python 2.2.1c1+, Lib/email/Generator.py 1.6.10.1

I changed the group to 2.2.1c1 because I will be merging
this fix into the standalone email package and Python 2.3
separately.

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

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