lanto03 / couchdb-python

Automatically exported from code.google.com/p/couchdb-python
Other
0 stars 0 forks source link

Multiple keys in POST-based view query can NOT be set or frozenset #175

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Just provide a `set` or `frozenset` as "keys" in a view:
db.view("_all_docs", group=True, keys=set_of_unique_keys)

What is the expected output? What do you see instead?

Set instance going directly into http.Session.request(...) and then everything 
becomes very bad :-)
json.encode raises TypeError and we have empty body in a POST request:
{{{
try:
   body = json.encode(body).encode('utf-8')
except TypeError:
   pass
}}}

Original issue reported on code.google.com by k.cherka...@gmail.com on 27 Mar 2011 at 12:53

GoogleCodeExporter commented 8 years ago
Most interesting question is why json encoding failure passed silently?
However, encoding of set and frozenset is not supported by simplejson/json 
modules by default, so you have to register your own handler for this types.

Original comment by kxepal on 27 Mar 2011 at 4:31

GoogleCodeExporter commented 8 years ago
This should be fixed by revision 2908fd72e112.

Original comment by djc.ochtman on 21 Sep 2012 at 8:09