I have visual studio 2017 consol Application that starting python script (python interpreter version 3.7), the python script is using C dll.
When I running this consol App in degug mode, everything working well, also when I excecuting it by cmd it works. The issue comes when I implementing it on Jenkins - using "Excecute windows batch command" I use same command as in CMD, which worked, it start running well but as reaching method from C dll in python script (the QLIB_IsPhoneConnected method), it giving me error "OSError: exception: access violation writing 0x00000000". Also, I tried to run the script from "CMD as administrator" and it fails on the same step. I checked Jenkins "Excecute windows batch command" and find it is "not" running as administrator. Summation: Running the visual studio executable from Jenkins "Excecute windows batch command" (which, as I found, is not administraor previlages) or from "CMD as administrator" getting error, but running visual studio in debuge mode or from CMD (not administrator) passed with no error.
Here are the relevant code part:
Visual studio (python runner):
ProcessStartInfo start = new ProcessStartInfo();
start.FileName = _pythonInterpeterDir + @"python.exe";
start.Arguments = string.Format("{0} {1}", _pythonInterpeterDir + @"QTM.py", command);
start.RedirectStandardOutput = true;
start.UseShellExecute = false;
using (Process process = Process.Start(start))
{
using (StreamReader reader = process.StandardOutput)
{
results = reader.ReadToEnd();
}
}
Python accessing C dll:
from ctypes import *
import time
import QRCT
qmslDllName = 'C:\\Program Files (x86)\\Qualcomm\\QDART\\bin\\QMSL_MSVC10R.dll'
QLIB_IsPhoneConnected = qmslDll['QLIB_IsPhoneConnected']
QLIB_IsPhoneConnected.restype = c_uint8
QLIB_IsPhoneConnected.argtypes = [c_uint32]
def isPhoneConnected(self):
status = QLIB_IsPhoneConnected(c_uint32(self.handle))
Please help me to understand what is defferencess between running from Jenkins "Excecute windows batch command" vs the CMD.
User contributions licensed under CC BY-SA 3.0