[1.1.0] IDE: Jython: Windows: exception traceback not complete --- fixed 2015-06-15+

Bug #1464225 reported by RaiMan on 2015-06-11
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sikuli
Critical
RaiMan

Bug Description

Hi RaiMan.
Here is my code: http://joxi.ru/XYmEg7MiBvzyA6
______________________________________________
# coding=utf-8
import sys
from os.path import dirname
from os import putenv
from sikuli.Sikuli import getBundlePath

TEST_DIR = dirname(dirname(dirname(getBundlePath())))
ROOT_DIR = dirname(TEST_DIR)

putenv('TEST_DIR', TEST_DIR)
putenv('ROOT_DIR', ROOT_DIR)

sys.path.append(TEST_DIR)
sys.path.append(ROOT_DIR)

from Core import API, Common, Config
from TestCases.DW import DW
from TestCases.Objects import Building, Dragon, Interface
from sikuli.Sikuli import sleep

######## Local info ########

dw = DW("Breeding Cave test")
dw.bookmark = '#bookmark=kix.e5b4mg9n2ok2'
dw.set_user(Config.USERS_FB[3])
dw.admin.load(dw.user, 'Breeding')
dw.start()
____________________________________________

I specially made an error in class DW in method start(). After starting script I get trace:
[error] script [ D:\autotest\dragon_world\TestCases\Building\BreedingCave.sikuli ] stopped with error in line 27
[error] ZeroDivisionError ( integer division or modulo by zero )
Exception in thread "MainThread" java.lang.IllegalStateException: No match found
 at java.util.regex.Matcher.group(Matcher.java:536)
 at org.sikuli.scriptrunner.JythonScriptRunner.findErrorSourceWalkTrace(JythonScriptRunner.java:356)
 at org.sikuli.scriptrunner.JythonScriptRunner.findErrorSource(JythonScriptRunner.java:321)
 at org.sikuli.scriptrunner.JythonScriptRunner.runPython(JythonScriptRunner.java:226)
 at org.sikuli.scriptrunner.JythonScriptRunner.runScript(JythonScriptRunner.java:183)
 at org.sikuli.scriptrunner.ScriptingSupport$RunBox.run(ScriptingSupport.java:597)
 at org.sikuli.scriptrunner.ScriptingSupport$RunBox.access$400(ScriptingSupport.java:513)
 at org.sikuli.scriptrunner.ScriptingSupport.runscript(ScriptingSupport.java:442)
 at org.sikuli.ide.SikuliIDE.run(SikuliIDE.java:206)
 at org.sikuli.ide.Sikulix.main(Sikulix.java:21)

This trace shows that error caused in line 27 of my script. But this error is not in this line, it's in imported module. But trace do not show this and this is not comfortable.
In earlier versions of SIkuli trace was full and showed complete path to the error.
Also I have code:
def log_uncaught_exceptions(type, value, tb):
    error("\n" + "\n".join(traceback.format_tb(tb)) + str(value))

sys.excepthook = log_uncaught_exceptions

which was getting trace and log it in my filelog.txt. Now it does not work, because you changed something in trace output. Can I turn it off somehow and get complete trace to the error, because this is very uncomfortable for debugging? (Remain classic jython trace)

RaiMan (raimund-hocke) on 2015-06-11
Changed in sikuli:
status: New → In Progress
importance: Undecided → High
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 2.0.0
RaiMan (raimund-hocke) on 2015-06-14
summary: - [1.1.0] IDE: Jython: exception trace not complete/accessible
+ [1.1.0] IDE: Jython: Windows: exception traceback not complete
Changed in sikuli:
status: In Progress → Fix Committed
importance: High → Critical
milestone: 2.0.0 → 1.1.0
summary: - [1.1.0] IDE: Jython: Windows: exception traceback not complete
+ [1.1.0] IDE: Jython: Windows: exception traceback not complete --- fixed
+ 2015-06-15+
Chp (chpnick) wrote :

Hi RaiMan, you repaired the problem of tracing the display? You want to make the switch, how do I use it?

RaiMan (raimund-hocke) wrote :

--- You want to make the switch
There is no switch. The problem I fixed, was just a problem on Windows matching file name separators.
So now you get the correct traceback info when running your script using SikuliX (either from GUI or from command line).

in the related question comment #6 I tried to elaborate, that when running scripts with SikuliX, the excepthook apparently does not work and how one should run scripts, to get it working (which in turn does not show the SikuliX special traceback and needs some other special treatments).

To clarify:
- the excepthook is used in case WHILE the script runs
- the evaluation of the traceback by SikuliX is done AFTER scriptrun (the interpreter has stopped running and returned to the Java layer)

so currently I can do nothing in SikuliX, to make your excepthook working, when you run your scripts with SikuliX.

Chp (chpnick) wrote :

Ok, thanks

Chp (chpnick) wrote :

Hello, I downloaded sikulixsetup-1.1.0-20150615.231028-105-forsetup.jar but did not find the change?

RaiMan (raimund-hocke) wrote :

just tested:
- download setup
- run setup
- run testscript

the traceback is reported as expected (though in the IDE message are the output is not broken into lines --- to be fixed)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions