#2715: Uploads from Flash 8 cannot be parsed in Python 2.3
---------------------------------+------------------------------------------
 Reporter:  [EMAIL PROTECTED]  |       Owner:  adrian     
     Type:  defect               |      Status:  new        
 Priority:  normal               |   Milestone:             
Component:  Core framework       |     Version:  SVN        
 Severity:  normal               |    Keywords:  upload http
---------------------------------+------------------------------------------
 Flash 8 SWF files can upload files to a server. It features progress
 monitoring and multiple file upload, making it a useful alternative to
 regular browser uploads. The HTTP request is improperly formatted however,
 missing an extra carriage return at the end. This results in the following
 (partial) stacktrace:
 
 {{{
   File "django/core/handlers/wsgi.py", line 99, in _get_post
     self._load_post_and_files()
   File "django/core/handlers/wsgi.py", line 77, in _load_post_and_files
     self._post, self._files = http.parse_file_upload(header_dict,
 self.raw_post_data)
   File "django/http/__init__.py", line 58, in parse_file_upload
     msg = email.message_from_string(raw_message)
   File
 
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/email/__init__.py",
 line 52, in message_from_string
     return Parser(_class, strict=strict).parsestr(s)
   File
 
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/email/Parser.py",
 line 75, in parsestr
     return self.parse(StringIO(text), headersonly=headersonly)
   File
 
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/email/Parser.py",
 line 64, in parse
     self._parsebody(root, fp, firstbodyline)
   File
 
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/email/Parser.py",
 line 206, in _parsebody
     raise Errors.BoundaryError(
 BoundaryError: No terminating boundary and no trailing empty line
 }}}
 
 I added patch that adds an extra carriage return after the post_data in
 parse_file_upload. To my knowledge, the patch doesn't affect normal
 uploads: Python's email parser parses them just fine. If it does, we could
 check for the user agent in the header.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/2715>
Django <http://code.djangoproject.org/>
The web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" 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-updates
-~----------~----~----~----~------~----~------~--~---

Reply via email to