[1.1.0] IDE: Error when saving script containing a comment block

Bug #1440175 reported by Tom Hinds on 2015-04-03
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Sikuli
High
RaiMan

Bug Description

Often, when I comment out large portions of my script using a comment block ("""), I'll receive an error when I save the file.

  "[error] IDE: Problem when trying to invoke menu action doSave Error: null"

This doesn't happen every time, but most of the time. The file still shows in unsaved mode (with the * in the tab) but the changes are saved. When I close/reopen the file, the script runs as expected.

This has happened through 1.1.0, but I was just able to track it down. I'm not sure if it happened in 1.0.1.

RaiMan (raimund-hocke) on 2015-04-04
summary: - Error when saving a comment block
+ [1.1.0] IDE: Error when saving script containing a comment block
Changed in sikuli:
status: New → In Progress
importance: Undecided → High
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
RaiMan (raimund-hocke) wrote :

I just tried to reproduce the problem: no success (at least on Mac).

The error message looks like some NPE (null pointer exception).

Could you start the IDE from command line using:
java -jar <path-to>sikulix.jar -d 3 -c

and try to reproduce.

either paste the debug output here or send it to my mail at https://launchpad.net/~raimund-hocke (top left)

Tom Hinds (thinds66) wrote :
Download full text (17.2 KiB)

[debug] RunTimeINIT: loadOptions: check: C:\Users\TomWin7\Desktop\SIKULI\NewSikuli
[debug] RunTimeINIT: loadOptions: check: C:\Users\TomWin7
[debug] RunTimeINIT: loadOptions: check: C:\Users\TomWin7\AppData\Roaming\Sikulix\SikulixStore
[debug] RunTimeINIT: global init: entering as: IDE
[debug] RunTimeINIT: ScreenDevice 0 contains (0,0) --- will be used as primary
[debug] RunTimeINIT: fSxBase: C:\Users\TomWin7\Desktop\SIKULI\NewSikuli
[debug] RunTimeINIT: runs as sikulix.jar in: C:\Users\TomWin7\Desktop\SIKULI\NewSikuli
[debug] RunTimeINIT: exists libs folder at: C:\Users\TomWin7\AppData\Roaming\Sikulix\SikulixLibs_201504030100
[debug] RunTimeINIT: addToWindowsSystemPath: added to systempath:
C:\Users\TomWin7\AppData\Roaming\Sikulix\SikulixLibs_201504030100
[debug] RunTimeINIT: checkJavaUsrPath: added to ClassLoader.usrPaths
***** show environment for IDE (build 201504030100)
user.home: C:\Users\TomWin7
user.dir (work dir): C:\Users\TomWin7\Desktop\SIKULI\NewSikuli
user.name: TomWin7
java.io.tmpdir: C:\Users\TomWin7\AppData\Local\Temp
running 32Bit on Windows (6.1) from a jar
java 7-32 version 1.7.0_55-b14 vm 24.55-b03 class 51.0 arch x86
app data folder: C:\Users\TomWin7\AppData\Roaming\Sikulix
libs folder: C:\Users\TomWin7\AppData\Roaming\Sikulix\SikulixLibs_201504030100
executing jar: C:\Users\TomWin7\Desktop\SIKULI\NewSikuli\sikulix.jar
*** classpath dump sikulix
  0: /C:/Users/TomWin7/Desktop/SIKULI/NewSikuli/sikulix.jar
*** classpath dump end
***** show environment end
[debug] RunTimeIDE: global init: leaving
[debug] RunTimeIDE: initIDEbefore: entering
[debug] RunTimeIDE: initIDEbefore: leaving
[debug] init user preferences
[debug] IDE: running with Locale: en_US
[debug] --- Sikuli parameters ---
[debug] 1: -d
[debug] 2: 3
[debug] 3: -c
[info] HotkeyManager: add Capture Hotkey: CTRL+SHIFT 9 (57, 3)
[debug] HotkeyManager: add Capture Hotkey: CTRL+SHIFT 9 (57, 3)
[info] HotkeyManager: add Abort Hotkey: ALT+SHIFT C (67, 9)
[debug] HotkeyManager: add Abort Hotkey: ALT+SHIFT C (67, 9)
[debug] ScriptingSupport: initScriptingSupport: enter
[debug] JythonSupport: init: starting
[debug] JythonSupport: init: success
[debug] JythonSupport: ***** Jython sys.path
 0: C:\Users\TomWin7\Desktop\SIKULI\NewSikuli\Lib
 1: C:\Users\TomWin7\Desktop\SIKULI\NewSikuli\sikulix.jar\Lib
 2: __classpath__
 3: __pyclasspath__/
[debug] JythonSupport: ***** Jython sys.path end
[debug] Jython: sikuli: Sikuli: starting init
[debug] RunTimeIDE: loadLib: VisionProxy.dll
[debug] Mouse: init
[debug] KeyBoard: init
[debug] Screen: initScreens: multi monitor mouse check
[debug] Screen: *** checking: S(0)[0,0 1920x1080] center: (960, 540) --- OK
[debug] Screen: *** checking: S(1)[1920,0 1280x1024] center: (2560, 512) --- OK
[debug] RunTimeIDE: loadLib: WinUtil.dll
[debug] Jython: requested to use as default region: R[0,0 1920x1080]@S(0)
[debug] Jython: sikuli: Sikuli: ending init
[debug] JythonScriptRunner: running Jython 2.7b4
[debug] ScriptingSupport: initScriptingSupport: added: jython
[debug] ScriptingSupport: initScriptingSupport: warning: org.sikuli.scriptrunner.IScriptRunner: Provider org.sikuli.scriptrunner.JRubyScriptRunner could not be instantiated
[debug] ScriptingS...

Hi Tom,

thanks for the valuable input.

Though I still cannot reproduce the behaviour on Mac (have to go to Windows later), the possible problem seems to be in the final part in the save process, where the code is analysed and unused images are deleted.

So you might test again, but this time switch off the respective option in the prefs:
Preferences -> more options ...

at the top in "Options on save" switch off "delete not used images" and <save> <ok>.
You need not restart the IDE in this case (the recommendation popup is non-selective ;-)

Have a nice time

Raimund

the build from 04-07 (tomorrow) will contain a revised error handling, so that the * should vanish in all cases, where the script was saved and as such avoids uncaught exceptions break the GUI.

so you might also repeat your test, without switching off the below mentioned option.

-----------------------

Hi Tom,

thanks for the valuable input.

Though I still cannot reproduce the behaviour on Mac (have to go to Windows later), the possible problem seems to be in the final part in the save process, where the code is analysed and unused images are deleted.

So you might test again, but this time switch off the respective option in the prefs:
Preferences -> more options ...

at the top in "Options on save" switch off "delete not used images" and <save> <ok>.
You need not restart the IDE in this case (the recommendation popup is non-selective ;-)

Have a nice time

Raimund

Tom Hinds (thinds66) wrote :

Hi Raimund,

I've been trying to reproduce the error a bit today with the new build and it no longer occurs. Thanks for your help! I'll continue to poke at it over the next week.

- Tom

Linda (linda-nordstrom) wrote :

Hi, just FYI
I have the build from 2015-06-03 of Sikuli 1.1.0
And I am also experiencing this issue.
If I try to save any code that have a block comment that is more than 30 lines long I cannot save the file from the IDE.

Linda (linda-nordstrom) wrote :

Update: it's not 30 lines of code, it is when the comment block contains 1085 or more characters.

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

Other bug subscribers