Message6411

Author anamitrab
Recipients anamitrab, nriley, otmarhumbel, pjenvey
Date 2011-02-27.04:53:36
SpamBayes Score 4.5615735e-07
Marked as misclassified No
Message-id <OFC2FC5EEB.D9FEB0ED-ON85257844.001AC57C-85257844.001ADBF2@us.ibm.com>
In-reply-to <1298437336.99.0.886527569916.issue1709@psf.upfronthosting.co.za>
Content
thanks Philip - that workaround worked.
Anamitra

  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |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>
_______________________________________
Files
File name Uploaded
ecblank.gif anamitrab, 2011-02-27.04:53:36
graycol.gif anamitrab, 2011-02-27.04:53:36
unnamed anamitrab, 2011-02-27.04:53:35
History
Date User Action Args
2011-02-27 04:53:36anamitrabsetrecipients: + anamitrab, otmarhumbel, pjenvey, nriley
2011-02-27 04:53:36anamitrablinkissue1709 messages
2011-02-27 04:53:36anamitrabcreate