I am running django rev 3581 with the streaming uploads patch -
3581-streaming_uploads_and_uploadprogress_middleware_x_progress_id.diff.

The streaming uploads work great for binary file types, but any time I
upload an M3U playlist file (and occassionally with other text files) I
get this AttributeError exception:

AttributeError at /file/compose/
tmp_name
Request Method:         POST
Request URL:    https://myhost/file/compose/
Exception Type:         AttributeError
Exception Value:        tmp_name
Exception Location:     /usr/lib/python2.4/cgi.py in __getattr__, line 540

Traceback (most recent call last):
File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/handlers/base.py"
in get_response
  74. response = callback(request, *callback_args, **callback_kwargs)
File "/files/lib/file/app/views.py" in createmessage
  306. if request.POST:
File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py"
in _get_post
  51. self._load_post_and_files()
File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py"
in _load_post_and_files
  32. self._post, self._files = http.parse_file_upload(self)
File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/http/__init__.py"
in parse_file_upload
  81. return req.parse_file_upload(req)
File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/middleware/upload.py"
in parse_streaming_file_upload
  104. FILES.appendlist(key, FileDict({
File "/usr/lib/python2.4/cgi.py" in __getattr__
  540. raise AttributeError, name

  AttributeError at /file/compose/
  tmp_name

The local vars in the cgi.py:540 look like this:

name = 'tmp_name'
self = FieldStorage('file1', 'chill.m3u', "MP3\\Bebel Gilberto\\Tanto
Tempo\\01 Samba da Benc\xe3o.mp3\r\nMP3\\Bebel Gilberto\\Tanto
Tempo\\05 Mais Feliz.mp3\r\nMP3\\Bebel Gilberto\\Tanto Tempo\\07 So
Nice (Summer Samba).mp3\r\nMP3\\Orchestra Baobab\\Pirate's Choice (CD
1)\\01-Utrus Horas.mp3\r\nMP3\\Orchestra Baobab\\Pirate's Choice (CD
1)\\04-Werente Serigne.mp3\r\n")

I posted this a while back and someone confirmed the problem but I
haven't seen any additional patches that correct the issue.  Has anyone
found a way to make this work reliably in Django?

Relevant parts of settings.py:

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.doc.XViewMiddleware',
    'django.middleware.upload.UploadStateMiddleware',
    'django.middleware.upload.StreamingUploadMiddleware',
)
STREAMING_UPLOADS=True
UPLOAD_BUFFER_SIZE=2048

Apache config:

<Location "/file">
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE file.settings
    PythonDebug On
    PythonPath "['/files/lib','/etc/xfile'] + sys.path"
</Location>

I'm running apache-2.0.54-5sarge1 with mod_python-3.2.10 built from
source using the apxs included with apache.

If there is any additional information needed, please feel free to ask.
 My nick is 'wondr' on irc.freenode.net.

Thank you!

Jacob


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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