Re: [Django] #9370: UnicodeDecodeError when serving binary static files through GZipMiddleWare

2009-06-12 Thread Django
#9370: UnicodeDecodeError when serving binary static files through 
GZipMiddleWare
-+--
  Reporter:  kikko   | Owner:  kkubasik
Status:  closed  | Milestone:  1.1 
 Component:  Core framework  |   Version:  1.0 
Resolution:  worksforme  |  Keywords:  
 Stage:  Accepted| Has_patch:  0   
Needs_docs:  0   |   Needs_tests:  0   
Needs_better_patch:  0   |  
-+--
Changes (by russellm):

  * status:  reopened => closed
  * resolution:  => worksforme

Comment:

 Can't reproduce with provided instructions.

-- 
Ticket URL: 
Django 
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 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #9370: UnicodeDecodeError when serving binary static files through GZipMiddleWare

2009-06-12 Thread Django
#9370: UnicodeDecodeError when serving binary static files through 
GZipMiddleWare
-+--
  Reporter:  kikko   | Owner:  kkubasik
Status:  reopened| Milestone:  1.1 
 Component:  Core framework  |   Version:  1.0 
Resolution:  |  Keywords:  
 Stage:  Accepted| Has_patch:  0   
Needs_docs:  0   |   Needs_tests:  0   
Needs_better_patch:  0   |  
-+--
Comment (by niksite):

 Sorry, formatting has been lost in my last message. This is repost with
 some additions.

 I have this reproduced with latest TRUNK:

 {{{
 [16:25 /home/niksite/webapps/django/datamining]$ ./manage.py runserver
 Validating models...
 0 errors found

 Django version 1.1 beta 1 SVN-10982, using settings 'datamining.settings'
 Development server is running at http://127.0.0.1:8000/
 Quit the server with CONTROL-C.
 Traceback (most recent call last):
   File "/home/niksite/lib/site-python/django/core/servers/basehttp.py",
 line 278, in run
 self.result = application(self.environ, self.start_response)
   File "/home/niksite/lib/site-python/django/core/servers/basehttp.py",
 line 636, in __call__
 return self.application(environ, start_response)
   File "/home/niksite/lib/site-python/django/core/handlers/wsgi.py", line
 245, in __call__
 response = middleware_method(request, response)
   File "/home/niksite/lib/site-python/django/middleware/gzip.py", line 16,
 in process_response
 if response.status_code != 200 or len(response.content) < 200:
   File "/home/niksite/lib/site-python/django/http/__init__.py", line 365,
 in _get_content
 return smart_str(''.join(self._container), self._charset)
   File "/home/niksite/lib/site-python/django/utils/encoding.py", line 119,
 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
 [12/Jun/2009 16:26:27] "GET /media/images/white.png HTTP/1.0" 500 1162
 }}}

 By the way, the following error is produced if gzip-middleware is
 disabled:
 {{{
 Traceback (most recent call last):
   File "/home/niksite/lib/site-python/django/core/servers/basehttp.py",
 line 278, in run
 self.result = application(self.environ, self.start_response)
   File "/home/niksite/lib/site-python/django/core/servers/basehttp.py",
 line 636, in __call__
 return self.application(environ, start_response)
   File "/home/niksite/lib/site-python/django/core/handlers/wsgi.py", line
 245, in __call__
 response = middleware_method(request, response)
   File "/home/niksite/lib/site-python/django/middleware/cache.py", line
 91, in process_response
 patch_response_headers(response, timeout)
   File "/home/niksite/lib/site-python/django/utils/cache.py", line 108, in
 patch_response_headers
 response['ETag'] = '"%s"' %
 md5_constructor(response.content).hexdigest()
   File "/home/niksite/lib/site-python/django/http/__init__.py", line 365,
 in _get_content
 return smart_str(''.join(self._container), self._charset)
   File "/home/niksite/lib/site-python/django/utils/encoding.py", line 119,
 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
 [12/Jun/2009 16:28:37] "GET /media/images/white.png HTTP/1.0" 500 1319
 }}}

 With cache-middleware disabled I see no errors:
 {{{
 [12/Jun/2009 16:29:31] "GET /media/images/white.png HTTP/1.0" 200 4233
 }}}

 I have the following settings:
 {{{
 MIDDLEWARE_CLASSES = (
 'django.middleware.cache.UpdateCacheMiddleware',
 #'django.middleware.http.ConditionalGetMiddleware',
 'django.middleware.gzip.GZipMiddleware',
 # 'debug_toolbar.middleware.DebugToolbarMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
 'django.middleware.cache.FetchFromCacheMiddleware',
 )
 CACHE_MIDDLEWARE_SECONDS = 0
 CACHE_BACKEND = "dummy://"
 MEDIA_URL = "http://127.0.0.1:8000/media/;
 }}}

 And the following lines in urls.py:
 {{{
 urlpatterns += patterns('',
 (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root':
 settings.MEDIA_ROOT}),
 }}}

-- 

Re: [Django] #9370: UnicodeDecodeError when serving binary static files through GZipMiddleWare

2009-06-12 Thread Django
#9370: UnicodeDecodeError when serving binary static files through 
GZipMiddleWare
-+--
  Reporter:  kikko   | Owner:  kkubasik
Status:  reopened| Milestone:  1.1 
 Component:  Core framework  |   Version:  1.0 
Resolution:  |  Keywords:  
 Stage:  Accepted| Has_patch:  0   
Needs_docs:  0   |   Needs_tests:  0   
Needs_better_patch:  0   |  
-+--
Changes (by niksite):

  * status:  closed => reopened
  * resolution:  invalid =>

Comment:

 I have this reproduced with latest TRUNK:

 [16:25 /home/niksite/webapps/django/datamining]$ ./manage.py runserver
 Validating models...
 0 errors found

 Django version 1.1 beta 1 SVN-10982, using settings 'datamining.settings'
 Development server is running at http://127.0.0.1:8000/
 Quit the server with CONTROL-C.
 Traceback (most recent call last):
   File "/home/niksite/lib/site-python/django/core/servers/basehttp.py",
 line 278, in run
 self.result = application(self.environ, self.start_response)
   File "/home/niksite/lib/site-python/django/core/servers/basehttp.py",
 line 636, in __call__
 return self.application(environ, start_response)
   File "/home/niksite/lib/site-python/django/core/handlers/wsgi.py", line
 245, in __call__
 response = middleware_method(request, response)
   File "/home/niksite/lib/site-python/django/middleware/gzip.py", line 16,
 in process_response
 if response.status_code != 200 or len(response.content) < 200:
   File "/home/niksite/lib/site-python/django/http/__init__.py", line 365,
 in _get_content
 return smart_str(''.join(self._container), self._charset)
   File "/home/niksite/lib/site-python/django/utils/encoding.py", line 119,
 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
 [12/Jun/2009 16:26:27] "GET /media/images/white.png HTTP/1.0" 500 1162


 By the way, the following error is produced if gzip-middleware is
 disabled:

 Traceback (most recent call last):
   File "/home/niksite/lib/site-python/django/core/servers/basehttp.py",
 line 278, in run
 self.result = application(self.environ, self.start_response)
   File "/home/niksite/lib/site-python/django/core/servers/basehttp.py",
 line 636, in __call__
 return self.application(environ, start_response)
   File "/home/niksite/lib/site-python/django/core/handlers/wsgi.py", line
 245, in __call__
 response = middleware_method(request, response)
   File "/home/niksite/lib/site-python/django/middleware/cache.py", line
 91, in process_response
 patch_response_headers(response, timeout)
   File "/home/niksite/lib/site-python/django/utils/cache.py", line 108, in
 patch_response_headers
 response['ETag'] = '"%s"' %
 md5_constructor(response.content).hexdigest()
   File "/home/niksite/lib/site-python/django/http/__init__.py", line 365,
 in _get_content
 return smart_str(''.join(self._container), self._charset)
   File "/home/niksite/lib/site-python/django/utils/encoding.py", line 119,
 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
 [12/Jun/2009 16:28:37] "GET /media/images/white.png HTTP/1.0" 500 1319

 With cache-middleware disabled I see no errors:
 [12/Jun/2009 16:29:31] "GET /media/images/white.png HTTP/1.0" 200 4233

-- 
Ticket URL: 
Django 
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 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #9370: UnicodeDecodeError when serving binary static files through GZipMiddleWare

2009-03-31 Thread Django
#9370: UnicodeDecodeError when serving binary static files through 
GZipMiddleWare
-+--
  Reporter:  kikko   | Owner:  kkubasik
Status:  closed  | Milestone:  1.1 
 Component:  Core framework  |   Version:  1.0 
Resolution:  invalid |  Keywords:  
 Stage:  Accepted| Has_patch:  0   
Needs_docs:  0   |   Needs_tests:  0   
Needs_better_patch:  0   |  
-+--
Changes (by kkubasik):

  * status:  new => closed
  * resolution:  => invalid

Comment:

 I cannot reproduce this against current trunk. Please reopen if you can
 create a test case which is reliably reproducible.

-- 
Ticket URL: 
Django 
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 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #9370: UnicodeDecodeError when serving binary static files through GZipMiddleWare

2009-03-31 Thread Django
#9370: UnicodeDecodeError when serving binary static files through 
GZipMiddleWare
-+--
  Reporter:  kikko   | Owner:  kkubasik
Status:  new | Milestone:  1.1 
 Component:  Core framework  |   Version:  1.0 
Resolution:  |  Keywords:  
 Stage:  Accepted| Has_patch:  0   
Needs_docs:  0   |   Needs_tests:  0   
Needs_better_patch:  0   |  
-+--
Changes (by kkubasik):

  * owner:  nobody => kkubasik

Comment:

 I'm going to look into this.

-- 
Ticket URL: 
Django 
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 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #9370: UnicodeDecodeError when serving binary static files through GZipMiddleWare

2009-02-26 Thread Django
#9370: UnicodeDecodeError when serving binary static files through 
GZipMiddleWare
-+--
  Reporter:  kikko   | Owner:  nobody
Status:  new | Milestone:  1.1   
 Component:  Core framework  |   Version:  1.0   
Resolution:  |  Keywords:
 Stage:  Accepted| Has_patch:  0 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by jacob):

  * needs_better_patch:  => 0
  * needs_docs:  => 0
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 0
  * milestone:  => 1.1

-- 
Ticket URL: 
Django 
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 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---