samintz
Scott Mintz
- May
- 1,590
- 27
I have a Python script I have to work with that has this code:
That --format statement extracts the author and email of the last person to modify the script_name.
That code works correctly in CMD, Powershell, and bash. However, because of the %'s, it fails in TCC. If I double the %'s it works in TCC but fails in CMD, Powershell, and bash. It just outputs %aN <%aE>
Aside from using SETDOS /x before running the script, do I have any alternatives?
Code:
cmd = 'cd {} && git log -1 --format="%aN <%aE>" -- {}'.format(
dir_name, script_name)
last_author_output = subprocess.check_output(
cmd, shell=True, universal_newlines=True)
That --format statement extracts the author and email of the last person to modify the script_name.
That code works correctly in CMD, Powershell, and bash. However, because of the %'s, it fails in TCC. If I double the %'s it works in TCC but fails in CMD, Powershell, and bash. It just outputs %aN <%aE>
Aside from using SETDOS /x before running the script, do I have any alternatives?