[1.1.1] osx 10.11.6 sikulix 1.1.0 save error (incomplete string problem) --- when comment contains ' --- fixed 1.1.1 2016-08-01

Bug #1607861 reported by Joe White on 2016-07-29
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sikuli
Critical
RaiMan

Bug Description

After working with a sikuli IDE 1.1.0 program, I save the file and get this error:

Delete images on save:
possible uncomplete string in line 1
No images will be delete!

All you can do is click OK. This error has somehow caused 24 .png files
to be deleted from the contents of the program.
I had a backup file with all of the patterns...but after I copied all of the patterns back in my program, I could still not save my new program.
The backup program lost it's patterns with the same error. This was quite
a bit of work to construct the proper icons and target offsets and correct
size regions. This is a critical problem to me....I have no way of recovering this data. Even a backup gets corrupted and putting the new info back in the program does not correct it.

Joe White (joe-white) wrote :
Joe White (joe-white) wrote :

This is the program after the error - still contains pattern file names which do not exist.

Joe White (joe-white) on 2016-07-29
description: updated
description: updated
RaiMan (raimund-hocke) on 2016-07-30
Changed in sikuli:
status: New → Invalid
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.1
RaiMan (raimund-hocke) wrote :

you are surely not working with 1.1.0 when this happens, since this "protection feature" was only implemented in version 1.1.1 lately.

If you have the option selected, that images not used in the script as "someimg.png", then when saving a script, images, that are not referenced in the script this way, are deleted.

before the above fix/feature, there where situations, where images where deleted, though they should not be deleted, caused by incomplete strings on a line. this is now detected and the image cleanup is not done (but the script is saved).

thanks for the scripts.
the zip file contains 2 scripts.
Which one is the one to look into?

Nevertheless I will check, what might lead to the popup.

Changed in sikuli:
status: Invalid → In Progress
importance: Undecided → High
summary: - osx 10.11.6 sikulix 1.1.0 save error
+ [1.1.1] osx 10.11.6 sikulix 1.1.0 save error (incomplete string problem)
RaiMan (raimund-hocke) on 2016-07-30
summary: [1.1.1] osx 10.11.6 sikulix 1.1.0 save error (incomplete string problem)
+ --- when comment contains '
Changed in sikuli:
status: In Progress → Fix Committed

the irritating popup is caused by the use of ' in a comment (didn't and let's)

so using
did not

instead of
didn't

does not lead to the popup.

In any case, with 1.1.1 no images would be deleted when this popup comes up for whatever reason.

The deletion of the images must have resulted in the use of the 1.1.0 before at a time when the script contained such an incomplete comment as mentioned above.

I will

Joe White (joe-white) wrote :

Python doesn't recognize strings in comments.
Seems a user should be able to put most anything
in comment.
I would have never figured this one out, although
I did make some changes in my script before I ran into this
problem trying to save them.
I did uncheck the "delete not used images" box in
the Preferences => more options in 1.1.0 to finally
make the box go away and keep my patterns from being
erased. I never saw any indication as to what caused this problem.
I still have the ' characters in my 1.1.0 script after turning off the "delete not used
images". I would recommend looking for the end of the comment
only. Python allows ''' for a block comment, but this doesn't
work either. I see what I need to do in order to work around this. Thanks.

RaiMan (raimund-hocke) wrote :

thanks for your patience.

I have fixed it. Would appreciate if you try it out.

summary: [1.1.1] osx 10.11.6 sikulix 1.1.0 save error (incomplete string problem)
- --- when comment contains '
+ --- when comment contains ' --- fixed 1.1.1 2016-08-01
Joe White (joe-white) wrote :

Tried the latest nightly build and it now shows me the error. I tried both answers, but no patterns were deleted. I just keep getting the error until I fix the problem....thanks Raimund!

Changed in sikuli:
status: Fix Committed → Confirmed
RaiMan (raimund-hocke) wrote :

Thanks for confirmation and feedback.

Status change: FixCommitted/Critical means: fixed in the latest nightly 1.1.1

Changed in sikuli:
status: Confirmed → Fix Committed
importance: High → Critical
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments