ossobv / pstore

Python Protected Password Store (django server + cli interface) using client side GPG encryption
42 stars 3 forks source link

Non-ascii issue in notify.py #6

Closed wdoekes closed 7 years ago

wdoekes commented 9 years ago
Environment:

Request Method: POST
Request URL: https://pstore.XXX.nl/pstore/object/

Django Version: 1.4.9
Python Version: 2.7.6
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'pstore')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'pstore.middleware.AuthenticateByNonceMiddleware',
 'django.middleware.transaction.TransactionMiddleware')

Traceback:
File "/srv/virtualenvs/pstore/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/srv/virtualenvs/pstore/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
  366.                 return self.admin_site.admin_view(view)(*args, **kwargs)
File "/srv/virtualenvs/pstore/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/srv/virtualenvs/pstore/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  89.         response = view_func(request, *args, **kwargs)
File "/srv/virtualenvs/pstore/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  196.             return view(request, *args, **kwargs)
File "/srv/virtualenvs/pstore/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
  25.             return bound_func(*args, **kwargs)
File "/srv/virtualenvs/pstore/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/srv/virtualenvs/pstore/local/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
  21.                 return func(self, *args2, **kwargs2)
File "/srv/virtualenvs/pstore/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in changelist_view
  1169.                 response = self.response_action(request, queryset=cl.get_query_set(request))
File "/srv/virtualenvs/pstore/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in response_action
  908.             response = func(self, request, queryset)
File "/srv/virtualenvs/pstore/local/lib/python2.7/site-packages/django/contrib/admin/actions.py" in delete_selected
  47.             queryset.delete()
File "/srv/virtualenvs/pstore/local/lib/python2.7/site-packages/django/db/models/query.py" in delete
  514.         collector.delete()
File "/srv/virtualenvs/pstore/local/lib/python2.7/site-packages/django/db/models/deletion.py" in decorated
  61.             func(self, *args, **kwargs)
File "/srv/virtualenvs/pstore/local/lib/python2.7/site-packages/django/db/models/deletion.py" in delete
  239.                     sender=model, instance=obj, using=self.using
File "/srv/virtualenvs/pstore/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py" in send
  172.             response = receiver(signal=self, sender=sender, **named)
File "/srv/virtualenvs/pstore/local/lib/python2.7/site-packages/pstore/models.py" in on_object_delete
  323.     notify_object_deletion(object=instance)
File "/srv/virtualenvs/pstore/local/lib/python2.7/site-packages/pstore/notify.py" in notify_object_deletion
  131.             print 'Sending mail to:', toaddr

Exception Type: UnicodeEncodeError at /pstore/object/
Exception Value: 'ascii' codec can't encode character u'\xe9' in position 3: ordinal not in range(128)

Where user.first_name contains non-ascii

wdoekes commented 7 years ago

Non-issue for debug mode only..