orientdb - python UnicodeDecodeError on long query using pyorient -
I use OrientDB and pyorient to try Python while trying to create a long query on my behalf I'm doing:
(from ('written_on') from (choose * from (* ('from' posted to '') ((Select from person * where * from @ liberation = # 14: 0))) @ Class = 'comment'
Here is a UCDDDCoding error my code:
$ Python Python 2.7.3 (Default, February 27, 2014, 19: 58:35) [GCC 4.6.3] Linux "Help", "Copyright", "Credit" or "License" for "More Information" on S2. Gt;>> Import Period> Client = Petroleum Orient (DB) 'Localhost', 2424) client.connect ('root', 'root') 10 >> Gt; & Gt; person = client.query (Select 'from person')>> For individuals: ... print person.name ... [good result]> gt; & gt; position = Client.query (Select from * (in (from 'post_b') (select * FROM person where @ RUDE = # 14: 0)) where @class = 'POS K ') file "& lt; Stdin & gt; ", from line 1 posts = select from 'client.query' (in trojars ('post_b') (select * from that person where @reid = # 14: 0)) where @class = 'post ') ^ Syntex error: invalid syntax →> select from "> client.query" (select from' Transfer In ('post_b') * (* from the person where @reid = # 14: 0)) where @class = 'post' ") for posts in posts: ... print post content ... [another good result]> gt; & gt; & gt; ; Comments = client.query ("Choose from * (TR Transfers in (from 'Post_b)' (select * from the person * where @reid = # 14: 0))) where @class = 'comment') traceback (Most recent call end): File "& lt; stdin>", in line 1, in & lt; Module & gt; The file "/usr/local/lib/python2.7/dist-packages/pyorient/ Orient.py", line 212, in query .prepare ((QUERY_SYNC, + + Arg) .end (). Fetch_response () file "/ Usr / local / lib / python2.7 / dist-packages / pyorient / utils.py ", line 47, wrap _ function return wrap (* args, ** quads) file" /usr/local/lib/python2.7/ Dist-packages / pyorient / utils.py ", line 60, wrap_function return wrap (* arg, ** quad) file" /usr/local/lib/python2.7/dist-packages/pyorient/messages/commands.py " , Line 131, Create Returns (Commandmates, Self) Prepare () file "/usr/local/lib/python2.7/dist-packages/pyorient/messages/base.py", line 72, self._encode_field ( X) self._fi for x Create in elds_definition file "/ usr / local / lib / pYthon2.7 / dist-packages / pyorient / messages / base.py", line 72, in & lt; genexpr & gt; self._encode_field for self ) ._fields_definition file "/usr/local/lib/python2.7/dist-packages/pyorient/messages/base.py", line 200, _encode_field buf = v.encode ('UTF-8') Unicodecode error: 'esi 'Can not decode the byte 0x9e in the codec 65: in the serial no category (128) & gt; & Gt; & Gt;
Although the last query runs on the OrientDB studio and gets the right result, this error occurs when you try to do this in a python.
Note: The data stored in the database is written in Arabic.
You have at least one older version since October 18, 2014. This bug should be fixed in the latest versions.
Comments
Post a Comment