Changeset 83416 in vbox for trunk/src/VBox/ValidationKit/common/utils.py
- Timestamp:
- Mar 25, 2020 4:29:07 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/common/utils.py
r83357 r83416 717 717 return sOutput; 718 718 719 def processOutputUnchecked(*aPositionalArgs, **dKeywordArgs): 720 """ 721 Similar to processOutputChecked, but returns status code and both stdout 722 and stderr results. 723 724 Extra keywords for specifying now output is to be decoded: 725 sEncoding='utf-8 726 fIgnoreEncoding=True/False 727 """ 728 sEncoding = dKeywordArgs.get('sEncoding'); 729 if sEncoding is not None: del dKeywordArgs['sEncoding']; 730 else: sEncoding = 'utf-8'; 731 732 fIgnoreEncoding = dKeywordArgs.get('fIgnoreEncoding'); 733 if fIgnoreEncoding is not None: del dKeywordArgs['fIgnoreEncoding']; 734 else: fIgnoreEncoding = True; 735 736 _processFixPythonInterpreter(aPositionalArgs, dKeywordArgs); 737 oProcess = processPopenSafe(stdout = subprocess.PIPE, stderr = subprocess.PIPE, *aPositionalArgs, **dKeywordArgs); 738 739 sOutput, sError = oProcess.communicate(); 740 iExitCode = oProcess.poll(); 741 742 if hasattr(sOutput, 'decode'): 743 sOutput = sOutput.decode(sEncoding, 'ignore' if fIgnoreEncoding else 'strict'); 744 if hasattr(sError, 'decode'): 745 sError = sError.decode(sEncoding, 'ignore' if fIgnoreEncoding else 'strict'); 746 return (iExitCode, sOutput, sError); 747 719 748 g_fOldSudo = None; 720 749 def _sudoFixArguments(aPositionalArgs, dKeywordArgs, fInitialEnv = True):
Note:
See TracChangeset
for help on using the changeset viewer.