2017-05-06 3 views
-1

Je suis en train de mettre à jour un document existant et je continue à obtenir un TypeError (quote_from_bytes() octets attendus)quote_from_bytes Obtenir() octets attendus lors de la mise à jour document CouchDB

mon code:

couch = couchdb.Server("<http>") 
couch.resource.credentials = ("USERNAME","PASSWORD") 
db = couch['mydb'] 

id = "183848484" 
doc = db[id] 

"""doing some operations on data here""" 

db[id] = doc 

Mon erreur log:

self.db[self.docID] = doc File "/home/sunilgopikrishna/.local/lib/python3.5/site-packages/couchdb/client.py", line 427, in setitem resource = _doc_resource(self.resource, id) File "/home/sunilgopikrishna/.local/lib/python3.5/site-packages/couchdb/client.py", line 1057, in _doc_resource return base(doc_id) File "/home/sunilgopikrishna/.local/lib/python3.5/site-packages/couchdb/http.py", line 537, in call obj = type(self)(urljoin(self.url, *path), self.session) File "/home/sunilgopikrishna/.local/lib/python3.5/site-packages/couchdb/http.py", line 678, in urljoin path = '/'.join([''] + [quote(s) for s in path]) File "/home/sunilgopikrishna/.local/lib/python3.5/site-packages/couchdb/http.py", line 678, in path = '/'.join([''] + [quote(s) for s in path]) File "/home/sunilgopikrishna/.local/lib/python3.5/site-packages/couchdb/http.py", line 630, in quote return util.urlquote(string, safe) File "/usr/lib/python3.5/urllib/parse.py", line 712, in quote return quote_from_bytes(string, safe) File "/usr/lib/python3.5/urllib/parse.py", line 737, in quote_from_bytes raise TypeError("quote_from_bytes() expected bytes") TypeError: quote_from_bytes() expected bytes

Merci.

+0

Il peut y avoir une faute de frappe dans votre ..check codant pour des citations erronées dans le 'doc' variable.Provide code restant – SmartManoj

+0

Salut @SmartManoj. .. Oui. Je crois qu'il y avait une erreur dans le code (un incorrect). – galeej

Répondre

0

Il y avait une erreur dans le codage (j'avais manqué)