Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error datetime decode #21

Closed
alexspirt opened this issue Oct 28, 2014 · 1 comment
Closed

error datetime decode #21

alexspirt opened this issue Oct 28, 2014 · 1 comment

Comments

@alexspirt
Copy link

I run this command:
client.command("create edge my from #12:3903 to #12:3913 set date_s = '2014-08-27 17:21:29'")
Property date_s has DATETIME type.

And get error:
Traceback (most recent call last):
File "create_graph.py", line 93, in
res = client.command("create edge my from #12:3903 to #12:3913 set date_s = '2014-08-27 17:21:29'")
File "/usr/lib64/python2.7/site-packages/pyorient-1.1.2-py2.7.egg/pyorient/orient.py", line 204, in command
.prepare(( QUERY_CMD, ) + args).send().fetch_response()
File "/usr/lib64/python2.7/site-packages/pyorient-1.1.2-py2.7.egg/pyorient/messages/commands.py", line 145, in fetch_response
return self._read_sync()
File "/usr/lib64/python2.7/site-packages/pyorient-1.1.2-py2.7.egg/pyorient/messages/commands.py", line 193, in _read_sync
res.append( self._read_record() )
File "/usr/lib64/python2.7/site-packages/pyorient-1.1.2-py2.7.egg/pyorient/messages/base.py", line 335, in _read_record
_res = ORecordDecoder( __res['content'].rstrip() )
File "/usr/lib64/python2.7/site-packages/pyorient-1.1.2-py2.7.egg/pyorient/serialization.py", line 156, in init
self.__decode()
File "/usr/lib64/python2.7/site-packages/pyorient-1.1.2-py2.7.egg/pyorient/serialization.py", line 189, in __decode
self._stateCase[self._state](char, c_class)
File "/usr/lib64/python2.7/site-packages/pyorient-1.1.2-py2.7.egg/pyorient/serialization.py", line 474, in __state_number
token_value = datetime.fromtimestamp(float(self._buffer))
ValueError: year is out of range

I think, line 474 in serialization.py should be changed from
token_value = datetime.fromtimestamp(float(self._buffer))
to
token_value = datetime.fromtimestamp(float(self._buffer) / 1000)

@Ostico
Copy link
Collaborator

Ostico commented Oct 28, 2014

Thank you for your contribution :)

This issue was already fixed, update your repository

#20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants