Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

NonASCII data in map/reduce functions when using stdlib json #227

Open

Description

@djc

From kxepal on August 03, 2013 15:57:16

What steps will reproduce the problem? See test_script.py

What is the expected output?

Reduced result

What do you see instead?

Traceback (most recent call last):
File "couchview.py", line 43, in
for row in db.query(params_fun, reduce_to_sum, language='python', group=True):
File "/home/user/.virtualenvs/bikes/local/lib/python2.7/site-packages/CouchDB-0.10dev-py2.7.egg/couchdb/client.py", line 1158, in iter
return iter(self.rows)
File "/home/user/.virtualenvs/bikes/local/lib/python2.7/site-packages/CouchDB-0.10dev-py2.7.egg/couchdb/client.py", line 1177, in rows
self._fetch()
File "/home/user/.virtualenvs/bikes/local/lib/python2.7/site-packages/CouchDB-0.10dev-py2.7.egg/couchdb/client.py", line 1164, in _fetch
data = self.view._exec(self.options)
File "/home/user/.virtualenvs/bikes/local/lib/python2.7/site-packages/CouchDB-0.10dev-py2.7.egg/couchdb/client.py", line 1060, in _exec
content = json.encode(body).encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd1 in position 51: ordinal not in range(128) Please use labels and text to provide additional information. Python-2.7.3
couchdb-python-0.8 and 0.10dev
stdlib json (there is no problem if simplejson used)

Attachment: test_script.py

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=227

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions