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

SourceForge.net noreply at sourceforge.net
Mon Aug 16 17:01:56 CEST 2004


Patches item #873418, was opened at 2004-01-08 19:08
Message generated for change (Comment added) 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: Closed
>Resolution: Accepted
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).


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

>Comment By: Barry A. Warsaw (bwarsaw)
Date: 2004-08-16 11:01

Message:
Logged In: YES 
user_id=12800

Patch accepted.  Checked into Python 2.3 and 2.4 along with
test cases.

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

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