You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Connect to a SAP HANA database and select columns which include a timestamp
e.g. This example should work on any HANA instance
cur.execute('select END_TIME from M_CONNECTIONS')
cur.fetchall()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pypyodbc.py", line 1795, in fetchall
row = self.fetchone()
File "pypyodbc.py", line 1844, in fetchone
value_list.append(buf_cvt_func(alloc_buffer.value))
File "pypyodbc.py", line 568, in dttm_cvt
if x == '': return None
ValueError: microsecond must be in 0..999999
The END_TIME column is HANA type TIMESTAMP. Below is the pdb output:
>>> cur.fetchall()
> pypyodbc.py(566)dttm_cvt()
-> if py_v3:
(Pdb) x
'2014-02-25 14:57:08.487000000'
What is the expected output? What do you see instead?
Expected output is no Traceback.
What version of the product are you using? On what operating system?
pypyodbc version: 1.2.1
python version: 2.7.2
OS version: Linux localhost.localdomain 2.6.32-279.19.1.el6.x86_64 #1 SMP Wed
Dec 19 07:05:20 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Please provide any additional information below.
NOTE: I fixed this locally, by changing the following line in dttm_cvt(x) from:
else: return
datetime.datetime(int(x[0:4]),int(x[5:7]),int(x[8:10]),int(x[10:13]),int(x[14:16
]),int(x[17:19]),int(x[20:].ljust(6,'0')))
to:
else: return
datetime.datetime(int(x[0:4]),int(x[5:7]),int(x[8:10]),int(x[10:13]),int(x[14:16
]),int(x[17:19]),int(x[20:25].ljust(6,'0')))
Original issue reported on code.google.com by iwi...@zenossinc.com on 25 Feb 2014 at 11:48
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
iwi...@zenossinc.com
on 25 Feb 2014 at 11:48The text was updated successfully, but these errors were encountered: