← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #150145]: IndexError: index out of range: 0

 

Question #150145 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/150145

RaiMan posted a new comment:
Good idea, but have you changed the Sikuli path entry accordingly
(though this has nothing to do with this problem)?

Your situation:

I had a look into the python library code.

- the initial subprocess problem seems to have vanished with the
relocation of Sikuli

- now you have another strange situation: since subprocess.py is not
able to identify the executable on your system (e.g. cmd.exe) it tries
to post a warning and in the respective warning.py, the problem is an
empty sys.argv[] (currently this is the case, when running in the IDE),
which is not checked there and sys.arrv[0] produces the  IndexError:
index out of range: 0.

- but this warning should never be produced, because the respective entry should be found in the subprocess.py
I had a look on my Win7 32 with what they try:

import os
print os._os_map.get(os._name)

which prints for me:
[['Windows'], [['C:\\Windows\\system32\\cmd.exe', '/c'], ['command.com', '/c']]]

subprocess tries to spawn these and takes the first that works. In your
case there is no working entry.

Suggestion:

Open Sikuli IDE and just run these 2 statements:

import os
print os._os_map.get(os._name)

the output should look like mine above.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.