This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: email/Message.py: del_param fails when specifying a header
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, doko
Priority: normal Keywords: patch

Created on 2004-01-09 00:08 by doko, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
message.patch doko, 2004-01-09 00:08 patch
Messages (2)
msg45222 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2004-01-09 00:08
[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).
msg45223 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2004-08-16 15:01
Logged In: YES 
user_id=12800

Patch accepted.  Checked into Python 2.3 and 2.4 along with
test cases.
History
Date User Action Args
2022-04-11 14:56:02adminsetgithub: 39793
2004-01-09 00:08:57dokocreate