python - Django attempting to load binary data as String -
when accessing django site, attempting load png image string. causing error? exact error , traceback follows:
unicodedecodeerror @ /home/ 'utf8' codec can't decode byte 0x89 in position 0: invalid start byte request method: request url: http://localhost:8080/home/ django version: 1.5.5 exception type: unicodedecodeerror exception value: 'utf8' codec can't decode byte 0x89 in position 0: invalid start byte exception location: /usr/lib/python2.7/encodings/utf_8.py in decode, line 16 python executable: /home/michael/bin/python python version: 2.7.9 python path: ['/home/michael/code/schoolapp/projectschoolapp', '/home/michael/code/schoolapp/projectschoolapp/djangoappengine/lib', '/home/michael/code/appengine/google_appengine', '/home/michael/code/appengine/google_appengine', '/usr/lib/python2.7', '/usr/lib/python2.7/lib-dynload', '/home/michael/code/appengine/google_appengine/lib/protorpc-1.0', '/home/michael/code/appengine/google_appengine/lib/webapp2-2.3', '/home/michael/code/appengine/google_appengine/lib/webob-1.1.1', '/home/michael/code/appengine/google_appengine/lib/yaml-3.10', '/home/michael/code/schoolapp/projectschoolapp/apps', '/home/michael/code/schoolapp/projectschoolapp/libs'] server time: wed, 8 jul 2015 23:17:18 +0000 unicode error hint string not encoded/decoded was: �png <br /> traceback switch copy-and-paste view /home/michael/code/schoolapp/projectschoolapp/django/core/handlers/base.py in get_response response = callback(request, *callback_args, **callback_kwargs) ... ▶ local vars /home/michael/code/schoolapp/projectschoolapp/apps/site_pages/views.py in landing_page logged_user = get_logged_user(request) ... ▶ local vars /home/michael/code/schoolapp/projectschoolapp/libs/helpers.py in get_logged_user profile_info['school'] = profile.school ... ▶ local vars /home/michael/code/schoolapp/projectschoolapp/django/db/models/fields/related.py in __get__ rel_obj = qs.get(**params) ... ▶ local vars /home/michael/code/schoolapp/projectschoolapp/django/db/models/query.py in num = len(clone) ... ▶ local vars /home/michael/code/schoolapp/projectschoolapp/django/db/models/query.py in __len__ self._result_cache = list(self.iterator()) ... ▶ local vars /home/michael/code/schoolapp/projectschoolapp/django/db/models/query.py in iterator row in compiler.results_iter(): ... ▶ local vars /home/michael/code/schoolapp/projectschoolapp/djangotoolbox/db/basecompiler.py in results_iter yield self._make_result(entity, fields) ... ▶ local vars /home/michael/code/schoolapp/projectschoolapp/djangotoolbox/db/basecompiler.py in _make_result value = self.ops.value_from_db(value, field) ... ▶ local vars /home/michael/code/schoolapp/projectschoolapp/djangotoolbox/db/base.py in value_from_db return self._value_from_db(value, *self._convert_as(field)) ... ▶ local vars /home/michael/code/schoolapp/projectschoolapp/djangoappengine/db/base.py in _value_from_db value = value.decode('utf-8') ... ▶ local vars /usr/lib/python2.7/encodings/utf_8.py in decode return codecs.utf_8_decode(input, errors, true) ... ▶ local vars
it seems either having decode unicode problem or .png file trying read possibly corrupt. have tried different .png file in place of problem 1 rule out?
this answer similar issue unicode answered here may help.
Comments
Post a Comment