[Patches] [ python-Patches-873418 ] email/Message.py: del_param fails when specifying a header

SourceForge.net noreply at sourceforge.net
Tue Jan 20 15:46:44 EST 2004


Patches item #873418, was opened at 2004-01-08 19:08
Message generated for change (Settings changed) made by bwarsaw
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=873418&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthias Klose (doko)
>Assigned to: Barry A. Warsaw (bwarsaw)
Summary: email/Message.py: del_param fails when specifying a header

Initial Comment:
[forwarded from http://bugs.debian.org/225421]

Consider the following code:

   import email.Message
   msg = email.Message.Message()
   msg.add_header('Content-Disposition', 'attachment',
filename='bud.gif')
   msg.del_param('filename', 'Content-Disposition')

According to the documentation, this should be the
correct syntax.
However, ValueError is raised in del_param.

   Traceback (most recent call last):
     File "pybug.py", line 4, in ?
       msg.del_param('filename', 'Content-Disposition')
     File "/usr/lib/python2.3/email/Message.py", line
675, in del_param
       for p, v in self.get_params(header,
unquote=requote):
   ValueError: need more than 1 value to unpack

It seems to me like a simple mistake of the argument
order in the get_params call. The included patch fixes
it, at least my program works again (maybe the same
mistake is made in more places).


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

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



More information about the Patches mailing list