Issue1001

classification
Title: regression: a jython program which used to work for 2.1 is not working on 2.2
Type: behaviour Severity: normal
Components: Core Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, leo_sakaguchi
Priority: Keywords:

Created on 2008-02-28.09:31:29 by leo_sakaguchi, last changed 2012-06-24.08:45:33 by tyh73bac.

Files
File name Uploaded Description Edit Remove
test.py leo_sakaguchi, 2008-02-28.09:31:28
prop1.html cen71ugu, 2012-06-07.19:29:26
prop2.html cen71ugu, 2012-06-07.19:29:35
prop3.html cen71ugu, 2012-06-07.19:29:44
prop4.html cen71ugu, 2012-06-07.19:29:54
prop5.html cen71ugu, 2012-06-07.19:30:08
prop6.html cen71ugu, 2012-06-07.19:30:19
prop7.html cen71ugu, 2012-06-07.19:30:30
prop8.html cen71ugu, 2012-06-07.19:30:42
prop9.html cen71ugu, 2012-06-07.19:30:52
prop10.html cen71ugu, 2012-06-07.19:31:09
prop11.html cen71ugu, 2012-06-07.19:31:18
prop12.html cen71ugu, 2012-06-07.19:31:30
prop13.html cen71ugu, 2012-06-07.19:31:43
prop14.html cen71ugu, 2012-06-07.19:31:54
prop15.html cen71ugu, 2012-06-07.19:32:06
prop16.html cen71ugu, 2012-06-07.19:32:16
prop17.html cen71ugu, 2012-06-07.19:32:26
prop18.html cen71ugu, 2012-06-07.19:32:37
prop19.html cen71ugu, 2012-06-07.19:32:48
prop20.html cen71ugu, 2012-06-07.19:32:58
prop21.html cen71ugu, 2012-06-07.19:33:10
prop22.html cen71ugu, 2012-06-07.19:33:20
prop23.html cen71ugu, 2012-06-07.19:33:30
prop24.html cen71ugu, 2012-06-07.19:33:41
prop25.html cen71ugu, 2012-06-07.19:33:55
prop26.html cen71ugu, 2012-06-07.19:34:06
prop27.html cen71ugu, 2012-06-07.19:34:20
prop28.html cen71ugu, 2012-06-07.19:34:35
prop29.html cen71ugu, 2012-06-07.19:34:45
prop30.html cen71ugu, 2012-06-07.19:34:55
prop31.html cen71ugu, 2012-06-07.19:35:08
prop32.html cen71ugu, 2012-06-07.19:35:22
prop33.html cen71ugu, 2012-06-07.19:35:36
prop34.html cen71ugu, 2012-06-07.19:36:05
prop35.html cen71ugu, 2012-06-07.19:36:16
prop36.html cen71ugu, 2012-06-07.19:36:30
prop37.html cen71ugu, 2012-06-07.19:36:41
prop38.html cen71ugu, 2012-06-07.19:36:51
prop39.html cen71ugu, 2012-06-07.19:37:03
prop40.html cen71ugu, 2012-06-07.19:37:13
prop41.html cen71ugu, 2012-06-07.19:37:23
prop42.html cen71ugu, 2012-06-07.19:37:33
prop43.html cen71ugu, 2012-06-07.19:37:55
prop44.html cen71ugu, 2012-06-07.19:38:04
prop45.html cen71ugu, 2012-06-07.19:38:14
prop46.html cen71ugu, 2012-06-07.19:38:25
prop47.html cen71ugu, 2012-06-07.19:38:34
prop48.html cen71ugu, 2012-06-07.19:38:45
Messages
msg3053 (view) Author: Leo Sakaguchi (leo_sakaguchi) Date: 2008-02-28.09:31:27
Symptom:

Attached Jython program doesn't work as intended on Jython 2.2 and 
2.2.1.  It works fine on Jython 2.1.  Tried it with Sun Java 1.5.0_13.

The program should print System.currentTimeMillis() per each 5 seconds 
for 60 seconds period (12-13 times), but with Jython 2.2, it won't 
print anything then finishes after 60 seconds.  The program uses 
java.util.concurrent libraries which are available at Java 5.0 and 
later.  Not sure where the root cause relies.
msg3054 (view) Author: Charlie Groves (cgroves) Date: 2008-02-28.17:38:59
System.currentTimeMillis returns a long which is wrapped in a PyLong
when exposed to Python.  As of 2.2, PyLong is a newstyle type so it only
exposes python methods on it.  In 2.1 it mistakenly exposed the Java
method toString.  Your System.currentTimeMillis().toString() throws an
AttributeError looking for toString.  You can use
str(System.currentTimeMillis()) instead.
msg3055 (view) Author: Leo Sakaguchi (leo_sakaguchi) Date: 2008-02-29.02:00:30
Thanks a lot pointing out the problem, also for a very agile answer.  
That solved my problem.

> Your System.currentTimeMillis().toString() throws an
> AttributeError looking for toString.

How did you figure out the exception?  No exception occurs when I ran 
the program natively.  Do I need to put some debug options to Jython so 
it runs in debug mode?  If I know the way, I'll use it next time.  
Thanks!
msg3056 (view) Author: Charlie Groves (cgroves) Date: 2008-02-29.17:15:12
>> Your System.currentTimeMillis().toString() throws an
>> AttributeError looking for toString.

>How did you figure out the exception?  No exception occurs when I ran 
>the program natively.  Do I need to put some debug options to Jython so 
>it runs in debug mode?  If I know the way, I'll use it next time.  
>Thanks!

The exception not showing actually has to do with java.util.concurrent,
not Jython.  When an exception is thrown by code run in an
ScheduledExcutionThreadService, there's no where for the exception to be
caught immediately, so concurrent can't just print it out to the console
because it isn't sure that you don't want to catch it.  However, when
you call get on the ScheduledFuture returned by schedule, it throws an
ExecutionException if the scheduled code threw and exception while it
was running.  The ExcecutionException thrown will return the original
exception from getCause.
History
Date User Action Args
2012-06-24 08:45:33tyh73bacsetfiles: - prop1.html
2012-06-24 08:15:01tyh73bacsetfiles: + prop1.html
2012-06-07 19:38:45cen71ugusetfiles: + prop48.html
2012-06-07 19:38:34cen71ugusetfiles: + prop47.html
2012-06-07 19:38:25cen71ugusetfiles: + prop46.html
2012-06-07 19:38:14cen71ugusetfiles: + prop45.html
2012-06-07 19:38:04cen71ugusetfiles: + prop44.html
2012-06-07 19:37:55cen71ugusetfiles: + prop43.html
2012-06-07 19:37:33cen71ugusetfiles: + prop42.html
2012-06-07 19:37:24cen71ugusetfiles: + prop41.html
2012-06-07 19:37:13cen71ugusetfiles: + prop40.html
2012-06-07 19:37:04cen71ugusetfiles: + prop39.html
2012-06-07 19:36:51cen71ugusetfiles: + prop38.html
2012-06-07 19:36:41cen71ugusetfiles: + prop37.html
2012-06-07 19:36:31cen71ugusetfiles: + prop36.html
2012-06-07 19:36:16cen71ugusetfiles: + prop35.html
2012-06-07 19:36:06cen71ugusetfiles: + prop34.html
2012-06-07 19:35:37cen71ugusetfiles: + prop33.html
2012-06-07 19:35:23cen71ugusetfiles: + prop32.html
2012-06-07 19:35:08cen71ugusetfiles: + prop31.html
2012-06-07 19:34:56cen71ugusetfiles: + prop30.html
2012-06-07 19:34:46cen71ugusetfiles: + prop29.html
2012-06-07 19:34:35cen71ugusetfiles: + prop28.html
2012-06-07 19:34:20cen71ugusetfiles: + prop27.html
2012-06-07 19:34:06cen71ugusetfiles: + prop26.html
2012-06-07 19:33:55cen71ugusetfiles: + prop25.html
2012-06-07 19:33:42cen71ugusetfiles: + prop24.html
2012-06-07 19:33:30cen71ugusetfiles: + prop23.html
2012-06-07 19:33:20cen71ugusetfiles: + prop22.html
2012-06-07 19:33:10cen71ugusetfiles: + prop21.html
2012-06-07 19:32:59cen71ugusetfiles: + prop20.html
2012-06-07 19:32:48cen71ugusetfiles: + prop19.html
2012-06-07 19:32:37cen71ugusetfiles: + prop18.html
2012-06-07 19:32:27cen71ugusetfiles: + prop17.html
2012-06-07 19:32:16cen71ugusetfiles: + prop16.html
2012-06-07 19:32:07cen71ugusetfiles: + prop15.html
2012-06-07 19:31:55cen71ugusetfiles: + prop14.html
2012-06-07 19:31:43cen71ugusetfiles: + prop13.html
2012-06-07 19:31:31cen71ugusetfiles: + prop12.html
2012-06-07 19:31:19cen71ugusetfiles: + prop11.html
2012-06-07 19:31:09cen71ugusetfiles: + prop10.html
2012-06-07 19:30:53cen71ugusetfiles: + prop9.html
2012-06-07 19:30:43cen71ugusetfiles: + prop8.html
2012-06-07 19:30:30cen71ugusetfiles: + prop7.html
2012-06-07 19:30:19cen71ugusetfiles: + prop6.html
2012-06-07 19:30:08cen71ugusetfiles: + prop5.html
2012-06-07 19:29:54cen71ugusetfiles: + prop4.html
2012-06-07 19:29:45cen71ugusetfiles: + prop3.html
2012-06-07 19:29:36cen71ugusetfiles: + prop2.html
2012-06-07 19:29:28cen71ugusetfiles: + prop1.html
2012-06-04 20:08:08cen71ugusetfiles: - 1.html
2012-06-04 20:07:58cen71ugusetfiles: + 1.html
2008-02-29 17:15:13cgrovessetmessages: + msg3056
2008-02-29 02:00:31leo_sakaguchisetmessages: + msg3055
2008-02-28 17:38:59cgrovessetstatus: open -> closed
resolution: wont fix
messages: + msg3054
nosy: + cgroves
2008-02-28 09:31:29leo_sakaguchicreate