[issue14720] sqlite3 microseconds

2013-02-26 Thread Petri Lehtinen
Petri Lehtinen added the comment: Fixed. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue14720] sqlite3 microseconds

2013-02-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset eb45fd74db34 by Petri Lehtinen in branch '2.7': Issue #14720: Enhance sqlite3 microsecond conversion, document its behavior http://hg.python.org/cpython/rev/eb45fd74db34 New changeset ae25a38e6c17 by Petri Lehtinen in branch '3.2': Issue #14720: Enh

[issue14720] sqlite3 microseconds

2013-02-24 Thread Petri Lehtinen
Petri Lehtinen added the comment: Serhiy Storchaka wrote: > convert_timestamp() can silently return wrong result if seconds > saved with more than millisecond precision (i.e. '2012-04-04 > 15:06:00.000123456'). I propose or truncate fractional part to 6 > digits ('{:0<6.6}') or explicitly raise a

[issue14720] sqlite3 microseconds

2013-02-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: convert_timestamp() can silently return wrong result if seconds saved with more than millisecond precision (i.e. '2012-04-04 15:06:00.000123456'). I propose or truncate fractional part to 6 digits ('{:0<6.6}') or explicitly raise an exception if len(timepart

[issue14720] sqlite3 microseconds

2013-02-23 Thread Petri Lehtinen
Petri Lehtinen added the comment: Applied, thanks! -- nosy: +petri.lehtinen resolution: -> fixed stage: -> committed/rejected status: open -> closed versions: +Python 3.4 ___ Python tracker __

[issue14720] sqlite3 microseconds

2013-02-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6911df35b7b6 by Petri Lehtinen in branch '2.7': Issue #14720: sqlite3: Convert datetime microseconds correctly http://hg.python.org/cpython/rev/6911df35b7b6 New changeset 46d5317a51fb by Petri Lehtinen in branch '3.2': Issue #14720: sqlite3: Convert

[issue14720] sqlite3 microseconds

2013-02-23 Thread Lowe Thiderman
Lowe Thiderman added the comment: Add patch for 2.7 branch with regression test. -- keywords: +patch Added file: http://bugs.python.org/file29188/issue14720.diff ___ Python tracker _

[issue14720] sqlite3 microseconds

2013-02-23 Thread Lowe Thiderman
Lowe Thiderman added the comment: > Can convert_timestamp(val) be implemented as > datetime.datetime.strptime(val.decode(), '%Y-%m-%d %H:%M:%S.%f')? No. The microseconds are not always included, as can be seen by the current implementation. Nice idea though! -- nosy: +thiderman _

[issue14720] sqlite3 microseconds

2013-02-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Can convert_timestamp(val) be implemented as datetime.datetime.strptime(val.decode(), '%Y-%m-%d %H:%M:%S.%f')? -- nosy: +serhiy.storchaka ___ Python tracker

[issue14720] sqlite3 microseconds

2012-05-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Can be reproduced with: >>> con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_DECLTYPES) >>> cur = con.cursor() >>> cur.execute("CREATE TABLE t (x TIMESTAMP)") >>> cur.execute("INSERT INTO t (x) VALUES ('2012-04-04 15:06:00.456')") >>> cur.execute(

[issue14720] sqlite3 microseconds

2012-05-04 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +ghaering versions: +Python 2.7, Python 3.3 ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue14720] sqlite3 microseconds

2012-05-03 Thread Frank Millman
New submission from Frank Millman : sqlite3/dbapi2.py contains the following - def convert_timestamp(val): datepart, timepart = val.split(b" ") timepart_full = timepart.split(b".") [...] if len(timepart_full) == 2: microseconds = int(timepart_f