FuzzkingCool Posted September 26, 2017 Report Share Posted September 26, 2017 I am running into an error while running the following command through a python subprocess: "C:\Program Files\PlasticSCM5\client\cm.exe" undochange . -R The error is reported with the error number 13, and the message: "Access is denied" When I run the command in the workspace directory using cmd.exe, it works. I have tried setting the cm.exe to "Run as administrator" by default, but it did not help. Here is some example code that should recreate this issue: import subprocess workspacePath = r"C:\Users\secretprod\wkspaces\studio_test" cmd = [ r"C:\Program Files\PlasticSCM5\client\cm.exe" , "undochange" , "." , "-R" ] try: proc = subprocess.Popen( cmd , stdin = subprocess.PIPE , stdout = subprocess.PIPE , stderr = subprocess.PIPE , cwd = workspacePath , universal_newlines = True ) except OSError as e: errorReports = e.errno , e.strerror , e.filename raise Exception( "An error occurred while trying to run the PlasticSCM cli: %s" % str( errorReports ) ) Any tips or help would be much appreciated! Thanks! Link to comment Share on other sites More sharing options...
manu Posted September 27, 2017 Report Share Posted September 27, 2017 Hello @karmakat, I have tested your python code and works just fine for me. Who's running the python script? Are you using a user that is not having permissions to use the "cm" tool or modify the "C:\Users\secretprod\wkspaces\studio_test" content? Link to comment Share on other sites More sharing options...
FuzzkingCool Posted September 27, 2017 Author Report Share Posted September 27, 2017 Hi Manu, Thx for your response. I used escaped paths for the working directory as well as the path to cm, and this problem disappeared. Strange that the code worked for you and not for me... but everything is OK now : ) Link to comment Share on other sites More sharing options...
manu Posted September 27, 2017 Report Share Posted September 27, 2017 Ummmm, yep. Maybe the Python version? Mine is: Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.