samuraisam / django-json-rpc

JSON-RPC Implementation for Django
MIT License
286 stars 83 forks source link

Unicode Error #60

Closed stereoit closed 9 years ago

stereoit commented 9 years ago

My tests are failing, is this bug in my code or can I avoid this?

======================================================================
ERROR: test_auction_pin (tender.tests.test_engine.TestAdminRpcWorkflow)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/rsmol/Code/websites/aukcejinak-engine/src/tender/tests/test_engine.py", line 1431, in test_auction_pin
    json_data = self.rpc_request(data, client)
  File "/home/rsmol/Code/websites/aukcejinak-engine/src/tender/tests/test_engine.py", line 98, in rpc_request
    response  = client.post('/rpc/', json.dumps(data), content_type='application/json')
  File "/home/rsmol/.virtualenvs/aukcejinak-engine/lib/python2.7/site-packages/django/test/client.py", line 482, in post
    secure=secure, **extra)
  File "/home/rsmol/.virtualenvs/aukcejinak-engine/lib/python2.7/site-packages/django/test/client.py", line 296, in post
    secure=secure, **extra)
  File "/home/rsmol/.virtualenvs/aukcejinak-engine/lib/python2.7/site-packages/django/test/client.py", line 358, in generic
    return self.request(**r)
  File "/home/rsmol/.virtualenvs/aukcejinak-engine/lib/python2.7/site-packages/django/test/client.py", line 440, in request
    six.reraise(*exc_info)
  File "/home/rsmol/.virtualenvs/aukcejinak-engine/lib/python2.7/site-packages/jsonrpc/site.py", line 227, in dispatch
    response, status = self.response_dict(request, D, json_encoder=json_encoder)
  File "/home/rsmol/.virtualenvs/aukcejinak-engine/lib/python2.7/site-packages/jsonrpc/site.py", line 179, in response_dict
    response['error'] = e.json_rpc_format
  File "/home/rsmol/.virtualenvs/aukcejinak-engine/lib/python2.7/site-packages/jsonrpc/exceptions.py", line 35, in json_rpc_format
    'message': "%s: %s" % (unicode(self.__class__.__name__), unicode(self.message)),
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 1: ordinal not in range(128)
stereoit commented 9 years ago

Ok, please close this as I learned the code is not passing sensible message but "< type 'exceptions.UnicodeDecodeError'>" .