IDE: script corrupted when reopened after save

Reported by Topagae@gmail.com on 2010-04-19
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sikuli
Medium
RaiMan

Bug Description

 In Sikuli, when I try to save "Save" or "Save as" it instead opens up a gui with the title "Open". When I just type in a name and click "Open" it seems to generate the files and .slk stuff all right. Sadly, code works and runs fine when I enter into IDE on straight fresh file, but when I "Open" the file I "Saved" the code shows up in the IDE just fine, but when run I always get the error:

[sikuli] [Error] Traceback (innermost last):
  (no code object) at line 0
SyntaxError: ('invalid syntax', ('<string>', 1, 46, "setBundlePath('C:/Users/Chris/Desktop/Chris' Stuff/Sikuli Scripts/Play Treasure Isle.sikuli/')"))

Which leads me to believe the bugged "Save" functionality has something to do with it because the code runs fine when I just type it in and run it.

Topagae@gmail.com (topagae) wrote :

 Further research into this seems to be that saving MIGHT work, but when I select it, the gui mistakenly is titled "Open" and the button to "Save" is also mislabeled "Open". It seems to save my work but it is dubious because Sukuli itself is also not working.

Topagae@gmail.com (topagae) wrote :

 Saves definitely not working. Code works and runs fine when I enter into IDE on straight fresh file, but when I "Open" the file I "Saved" the code shows up in the IDE just fine, but when run I always get the error:

[sikuli] [Error] Traceback (innermost last):
  (no code object) at line 0
SyntaxError: ('invalid syntax', ('<string>', 1, 46, "setBundlePath('C:/Users/Chris/Desktop/Chris' Stuff/Sikuli Scripts/Play Treasure Isle.sikuli/')"))

Which leads me to believe the bugged "Save" functionality has something to do with it because the code runs fine when I just type it in and run it.

description: updated
RaiMan (raimund-hocke) wrote :

Pls. make following test:

Use the "fresh" version and export it as executable. Then run this from command line. I guess it works.

To further help you, pls. paste your script. You may use my direct mail address if you want.

RaiMan (raimund-hocke) on 2010-04-19
summary: - Cannot save files in Sikuli
+ IDE: script corrupted when reopened after save
Topagae@gmail.com (topagae) wrote :

Every script has behaved in the same broken way when trying to save, but for easiness' sake I've been using

doubleClick()

With an image of Firefox as my target.

Exporting as an executable ALSO brings up the false "Open" gui, but saved as a .skl file, and seems to run from the command line just fine. Sadly I can't open this executable file for editing, or perhaps I don't know how. Either way this doesn't solve my problem of being unable to save my work. Hopefully it helps though.

RaiMan (raimund-hocke) wrote :

ok, I think I got it:
your folder on desktop is named "Chris' Stuff".

This ' should not be there.

name the folder "ChrisStuff" and it works, I guess.

General tipp: in file and folder names avoid blanks and special characters (only - and _).

RaiMan (raimund-hocke) on 2010-04-19
Changed in sikuli:
status: New → Invalid
Topagae@gmail.com (topagae) wrote :

 Wow talk about jumping the gun. For one you don't explain why that would break anything, though I can hazard a guess. For two it doesn't fix my problem at all, I can "Save" a file anywhere and it breaks in exactly the same way. For three on a complete fresh install on both this computer and a laptop with the same OS with the same Java Run Time. Same exact problem, all saved to the desktop.

Changed in sikuli:
status: Invalid → In Progress
RaiMan (raimund-hocke) on 2010-04-19
Changed in sikuli:
status: In Progress → New
RaiMan (raimund-hocke) wrote :

Ok, the syntax error reported in your first statement is raised, because the string
'C:/Users/Chris/Desktop/Chris' Stuff/Sikuli Scripts/Play Treasure Isle.sikuli/'
is broken by the additional ' in the folder name "Chris' Stuff".

This happens when restarting the saved script after reloading it. Its an internal necessity to tell all the Sikuli classes and methods where to find the images:
setBundlePath('C:/Users/Chris/Desktop/Chris' Stuff/Sikuli Scripts/Play Treasure Isle.sikuli/')

Since I cannot "see" what you are doing, I take the chance to guess and I'm not unhappy with my rate to hit the target ;-)

So again, pls. try the following: (I "guess" you are using version 0.9.9 ?-)

1. start the IDE
2. type "import os" (has nothing to do with Sikuli, is python)
3, "save as" directly to the desktop (no subfolder) as test.sikuli
4. stop IDE
5. restart IDE
6. open the test.sikuli
7. run it

If you still get any error, you really have a serious problem, that I can't "guess" right now.

RaiMan (raimund-hocke) on 2013-02-22
Changed in sikuli:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → RaiMan (raimund-hocke)
tags: added: idemenu
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers