I have a script that makes a copy of a file and uploads it to SharePoint. When the .bat (that refers to the .py script) is run, the file gets uploaded to SharePoint, but in Task Scheduler, the logs return a "0x1" error.
I initially thought this was a Task Scheduler issue, being that 0x1 is a widely reported issue, but another script running on the same server works fine with the same path formatting. I even tried referencing the Office365 python script in another script that I scheduled to run around the same time, but it only executes the first script that doesn't contain any Office365 library, and refuses to execute the Office365 script with a 0x1 error.
So, do scheduled scripts, for any reason, refuse to work with Office365-REST-Python-Client? Diverging from Office365, is there an alternative way to automate spreadsheet generation in SharePoint?
You need to use ABSOLUTE paths everywhere and be careful not to make any assumptions about the working directory and such.
The user you are executing your script might not have the paths set correctly and might not see your python or the python modules, etc (check the value of the PATH and PYTHONPATH. (Check as well what user you use to run your task in the Task Scheduler).
I have a script that makes a copy of a file and uploads it to SharePoint. When the .bat (that refers to the .py script) is run, the file gets uploaded to SharePoint, but in Task Scheduler, the logs return a "0x1" error.
I initially thought this was a Task Scheduler issue, being that 0x1 is a widely reported issue, but another script running on the same server works fine with the same path formatting. I even tried referencing the Office365 python script in another script that I scheduled to run around the same time, but it only executes the first script that doesn't contain any Office365 library, and refuses to execute the Office365 script with a 0x1 error.
So, do scheduled scripts, for any reason, refuse to work with Office365-REST-Python-Client? Diverging from Office365, is there an alternative way to automate spreadsheet generation in SharePoint?