Forwarded from the Django dev list in the hopes that future searchers
find this...

The python2.4 email module has a bug which affects Django upload
handling for multipart forms (e.g. forms w/ file uploads).

---------- Forwarded message ----------
From: Jeremy Dunck <[EMAIL PROTECTED]>
Date: Dec 6, 2006 11:59 AM
Subject: Re: New faster SelectBox.js
To: [email protected]


On 12/6/06, Graham King <[EMAIL PROTECTED]> wrote:
> PS:
> If you have lots of elements in your select box, and your object has a
> FileField (meaning multipart encoding on your form), you might run into
> an intermittent bug Saving, whereby in http.__init__ on this line:
>
> name_dict = parse_header(submessage['Content-Disposition'])[1]
>
> parse_header gets give None.
> This is, believe it or not, a Python email package bug:
> > http://sourceforge.net/tracker/index.php?func=detail&aid=1555570&group_id=5470&atid=305470


Christ, I've been trying half-heartedly to reproduce that for ages.

I just pinged the python bug to get it fixed.

I don't see a way to work around this without patching
email.message_from_string.

All, here's a traceback for the problem, for future searchers:

 File "/pegasus/code/current/django/utils/httpwrappers.py", line 46,
in parse_file_upload
   name_dict = parse_header(submessage['Content-Disposition'])[1]

 File "/usr/lib/python2.4/cgi.py", line 331, in parse_header
   plist = map(lambda x: x.strip(), line.split(';'))

AttributeError: 'NoneType' object has no attribute 'split'

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to