[Python-bugs-list] [ python-Bugs-824417 ] exception with Message.get_filename()

SourceForge.net noreply at sourceforge.net
Wed Oct 15 17:39:27 EDT 2003


Bugs item #824417, was opened at 2003-10-15 17:39
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=824417&group_id=5470

Category: Python Library
Group: Python 2.2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Stuart D. Gathman (customdesigned)
Assigned to: Nobody/Anonymous (nobody)
Summary: exception with Message.get_filename()

Initial Comment:
The following scriptlet:
-----------t.py-----------------
import sys
import email

msg = email.message_from_file(sys.stdin)
for part in msg.walk():
  print part.get_params()
  print part.get_filename()
--------------------------------
gets an exception when fed the attached email
(extracted from a real life non-spam message).

$ python2 t.py <test1
[('multipart/mixed', ''), ('boundary',
'=-mkF0Ur/S0HaYfa60OEsM')]
None
[('multipart/alternative', ''), ('boundary',
'=-VowfKaQaEHb81enMCUlR')]
None
[('text/plain', '')]
None
[('text/html', ''), ('charset', 'utf-8')]
None
[('application/rtf', ''), ('name', (None, None, '14676
World Transportation Systems OF, from arrival TIA
terminal to door and from Durres port to TIA.rtf'))]
Traceback (most recent call last):
  File "t.py", line 7, in ?
    print part.get_filename()
  File "/usr/lib/python2.2/email/Message.py", line 711,
in get_filename
    return unicode(newvalue[2], newvalue[0])
TypeError: unicode() argument 2 must be string, not None


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

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



More information about the Python-bugs-list mailing list