← Back to team overview

sikuli-driver team mailing list archive

[Question #263086]: Bat file - cannot copy folder if .py file is triggerred by bat file

 

New question #263086 on Sikuli:
https://answers.launchpad.net/sikuli/+question/263086

Hello, 


If my .py file includes "copy folder" command and the python file it is triggered via bat file, the system will output an error.


[1] My .py code is: 
# Delete folder if exists
import os
import shutil
foldertobeDeleted = "D:\Tester600"
if os.path.exists(foldertobeDeleted):
    shutil.rmtree(foldertobeDeleted)
# Copy sources 
copy = os.path.join(r"C:\datas")
paste = os.path.join("D:\Tester600")
shutil.copytree(copy, paste)
print ("aaaa")
======================================
[2] My bat file code is:
start /i /b /wait C:\Sikuli\sikuli\sikuli\runIDE.cmd -r "C:\Users\gmunteanu\Desktop\automat\teste\test.sikuli"
======================================
[3] The error returned in console
[error] shutil.Error ( ['C:\\datas', 'D:\\Tester600', "[Errno 5] Input/output error: 'D:\\\\Tester600'"] )
Exception in thread "main" java.lang.IllegalStateException: No match found
        at java.util.regex.Matcher.group(Unknown Source)
        at org.sikuli.scriptrunner.JythonScriptRunner.findErrorSourceWalkTrace(JythonScriptRunner.java:326)
        at org.sikuli.scriptrunner.JythonScriptRunner.findErrorSource(JythonScriptRunner.java:290)
        at org.sikuli.scriptrunner.JythonScriptRunner.runPython(JythonScriptRunner.java:200)
        at org.sikuli.scriptrunner.JythonScriptRunner.runScript(JythonScriptRunner.java:162)
        at org.sikuli.basics.SikuliScript.main(SikuliScript.java:181)
        at org.sikuli.ide.SikuliIDE.main(SikuliIDE.java:212)
===================================================================
[4] 
Note: if I run the code in python IDLE editor, there are no errors.
Note: there were no problems when using copy file command (python file triggered by bat). 
Note: as a workaround I will copy all the files.

If you get the chance, please share a hint.

Take care.

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