#9370: UnicodeDecodeError when serving binary static files through GZipMiddleWare ----------------------------+----------------------------------------------- Reporter: kikko | Owner: nobody Status: new | Milestone: Component: Core framework | Version: 1.0 Keywords: | Stage: Unreviewed Has_patch: 0 | ----------------------------+----------------------------------------------- When serving binary static files (for example images) using django.views.static.serve and using GZipMiddleware a traceback is returned instead of the image:
{{{ Traceback (most recent call last): File "/lib/python2.5/site-packages/Django-1.0_final- py2.5.egg/django/core/servers/basehttp.py", line 277, in run self.result = application(self.environ, self.start_response) File "/lib/python2.5/site-packages/Django-1.0_final- py2.5.egg/django/core/servers/basehttp.py", line 634, in __call__ return self.application(environ, start_response) File "/lib/python2.5/site-packages/Django-1.0_final- py2.5.egg/django/core/handlers/wsgi.py", line 243, in __call__ response = middleware_method(request, response) File "/lib/python2.5/site-packages/Django-1.0_final- py2.5.egg/django/middleware/gzip.py", line 16, in process_response if response.status_code != 200 or len(response.content) < 200: File "/lib/python2.5/site-packages/Django-1.0_final- py2.5.egg/django/http/__init__.py", line 359, in _get_content return smart_str(''.join(self._container), self._charset) File "/lib/python2.5/site-packages/Django-1.0_final- py2.5.egg/django/utils/encoding.py", line 97, in smart_str return s.decode('utf-8', errors).encode(encoding, errors) File "/usr/lib/python2.5/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0x89 in position 0: unexpected code byte }}} -- Ticket URL: <http://code.djangoproject.com/ticket/9370> Django <http://code.djangoproject.com/> 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 django-updates@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-updates?hl=en -~----------~----~----~----~------~----~------~--~---