Issue2271

classification
Title: datetime.date, datetime.time, datetime.datetime are missing __tojava__ method
Type: behaviour Severity: normal
Components: Core Versions: Jython 2.7
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: zyasoft Nosy List: beachmachine, zyasoft
Priority: urgent Keywords: patch

Created on 2015-02-22.12:06:35 by beachmachine, last changed 2015-03-09.18:01:17 by zyasoft.

Files
File name Uploaded Description Edit Remove
datetime.py beachmachine, 2015-02-22.12:11:48
datetime_tojava.patch beachmachine, 2015-02-22.12:12:10
Messages
msg9541 (view) Author: Andreas Stocker (beachmachine) Date: 2015-02-22.12:11:01
Since changeset 7573 the classes datetime.date, datetime.time and datetime.datetime do not have a __tojava__ method any more. This breaks parameterized SQL statements that are using objects of these types as parameters - as used by Django.
msg9542 (view) Author: Andreas Stocker (beachmachine) Date: 2015-02-22.12:11:48
Attached a fixed version of Lib/datetime.py.
msg9544 (view) Author: Jim Baker (zyasoft) Date: 2015-02-22.15:11:27
We need to add corresponding tests, presumably test_datetime_jy.py, so we don't break in the future.

Blocker for RC1
msg9570 (view) Author: Jim Baker (zyasoft) Date: 2015-03-03.05:26:53
Fixed as of https://hg.python.org/jython/rev/67210f355576

Note that test_datetime_jy was defined, however, its tests were not set up properly to be discovered by regrtest. However, the original tests did not test that the conversion was correct.

Also now supports tzinfo if defined, otherwise uses UTC.
History
Date User Action Args
2015-03-09 18:01:17zyasoftsetstatus: pending -> closed
2015-03-03 05:27:04zyasoftsetstatus: open -> pending
2015-03-03 05:26:53zyasoftsetassignee: zyasoft
resolution: accepted -> fixed
messages: + msg9570
2015-02-22 15:11:27zyasoftsetpriority: urgent
resolution: accepted
messages: + msg9544
nosy: + zyasoft
2015-02-22 12:12:10beachmachinesetfiles: + datetime_tojava.patch
keywords: + patch
2015-02-22 12:11:51beachmachinesetfiles: + datetime.py
messages: + msg9542
2015-02-22 12:11:02beachmachinesetmessages: + msg9541
2015-02-22 12:06:35beachmachinecreate