소스 검색

纠正命令行问题;

Jeff 5 년 전
부모
커밋
e9e2c14583
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      SATService/SATService/PythonExecutor.cpp
  2. 1 1
      SATService/SATService/SATExecutor.cpp

+ 2 - 2
SATService/SATService/PythonExecutor.cpp

@@ -185,7 +185,7 @@ int CPythonExecutor::RunScriptProcess()
 	// 强制stdion, stdout和stderr完全无缓冲:python -u
 	TCHAR szCommandLine[MAX_PATH] = { 0 };
 	if (_tcslen(m_szExtraSentence))
-		_stprintf_s(szCommandLine, _T("python -W ignore -u \"%s\" %s"), m_szScriptPath, m_szExtraSentence);
+		_stprintf_s(szCommandLine, _T("python -W ignore -u \"%s\" \"%s\""), m_szScriptPath, m_szExtraSentence);
 	else
 		_stprintf_s(szCommandLine, _T("python -W ignore -u \"%s\""), m_szScriptPath);
 
@@ -344,7 +344,7 @@ int CPythonExecutor::ServiceRunScriptProcess()
 	// 强制stdion, stdout和stderr完全无缓冲:python -u
 	TCHAR szCommandLine[MAX_PATH] = { 0 };
 	if (_tcslen(m_szExtraSentence))
-		_stprintf_s(szCommandLine, _T("python -W ignore -u \"%s\" %s"), m_szScriptPath, m_szExtraSentence);
+		_stprintf_s(szCommandLine, _T("python -W ignore -u \"%s\" \"%s\""), m_szScriptPath, m_szExtraSentence);
 	else
 		_stprintf_s(szCommandLine, _T("python -W ignore -u \"%s\""), m_szScriptPath);
 

+ 1 - 1
SATService/SATService/SATExecutor.cpp

@@ -191,7 +191,7 @@ SATHTTP::STCase* CSATExecutor::ExecuteFreeCaseScript(SATHTTP::STTask* pTask)
 #endif
 		// ÃüÁîÐУº{"Round": %d}
 		TCHAR szCommandLine[MAX_PATH] = { 0 };
-		_stprintf_s(szCommandLine, _T("{\"Round\": %s"), pCase->_strRoundNum.c_str());
+		_stprintf_s(szCommandLine, _T("{'Round': '%s'}"), pCase->_strRoundNum.c_str());
 		if ( !pCase->_pExcutor ) {
 			CPythonExecutor *pExcutor = new CPythonExecutor(); 
 			if ( pExcutor ) {