thanks Philip - that workaround worked.
Anamitra

Inactive hide details for Philip Jenvey ---02/23/2011 12:05:31 AM---Philip Jenvey <pjenvey@underboss.org> added the comment: LiPhilip Jenvey ---02/23/2011 12:05:31 AM---Philip Jenvey <pjenvey@underboss.org> added the comment: Like I said on the ML ( http://old.nabble.c


From:

Philip Jenvey <report@bugs.jython.org>

To:

Anamitra Bhattacharyya/Bedford/IBM@IBMUS

Date:

02/23/2011 12:05 AM

Subject:

[issue1709] jsr223 bug when dealing with datetime module






Philip Jenvey <pjenvey@underboss.org> added the comment:

Like I said on the ML (
http://old.nabble.com/Re%3A-jython-2.5.2-jsr-223-bug-p30988917.html ), the fact that the jsr223 ScriptEngineScope has always done this __tojava__/Py.java2py dance must cause this

datetime.date.__tojava__ returns a java.sql.Date. That doesn't necessarily mean Py.java2py(java.sql.Date) will give you a datetime.date back

Plus I think this "feature" could cause a significant slowdown of python code executing with the scope of the jsr223 context. Historically it's behavior adopted from the old jsr223 implementation. It needs to be rethought

Anamitra, thanks for the logging this, in your case you may be able to hack around the problem by disabling datetime.date's tojava conversion by calling this after importing datetime:

del datetime.date.__tojava__

this issue likely also affects datetime.time/datetime, Decimal and threading.Thread objects

----------
nosy: +otmarhumbel, pjenvey

_______________________________________
Jython tracker <report@bugs.jython.org>
<
http://bugs.jython.org/issue1709>
_______________________________________