Issue 873418: email/Message.py: del_param fails when specifying a header (original) (raw)

[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).