Sikuli can no longer create new files

Asked by Ryan

Hi all,

Would really appreciate any insight on this, as I've spent a lot of time troubleshooting to no avail. I'm using Sikuli on a VM to do some morning checkouts for a suite of applications, and one week Sikuli stopped being able to write new files for screenshots or logs. I also use it to encrypt login information, which involves creating and deleting a cipher text file every time a script is run. However, I keep getting thrown this error:

[error] IOError ( (2, 'No such file or directory', 'I:\\Sikuli\\New folder\\Untitled.sikuli\\New Text Document.txt') )

Even though the line of code the error refers to is:

cipherFile = open('I:\\Sikuli\\New folder\\Untitled.sikuli\\New Text Document.txt', 'r+')

Which should create the file if it does not exist. I've tried changing permissions on the folder its trying to write to, upgrading Sikuli to 1.1.1, and even manually creating I:\\Sikuli\\New folder\\Untitled.sikuli\\New Text Document.txt so that Sikuli could just write to it rather than have to make a new file. Still no dice. Does anyone have any ideas? Would be greatly appreciated, I could use a fresh set of eyes on it.

Thanks!

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

According to Python rules, file mode r does not create files, if they are not there, only w and a do that.
Here is a good explanation of the file modes:
https://stackoverflow.com/questions/1466000/python-open-built-in-function-difference-between-modes-a-a-w-w-and-r

So it might be, that it worked with an older version of SikuliX which had Jython 2.5 on board (which then was an incompatibility)

Latest SikuliX has Jython 2.7 on board, which works as expected.

Can you help with this problem?

Provide an answer of your own, or ask Ryan for more information if necessary.

To post a message you must log in.