Я пытаюсь отправить git push
команду с subprocess.Popen
. Команда выполнена успешно, но вывод команды git возвращается subprocess
в stderr
вместо stdout
def execute_cmds(commands):
for cmd in commands:
send_commands = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
shell=True
)
send_commands.wait()
output, errors = send_commands.communicate()
print('OUTPUT: {}'.format(output))
print('ERRORS: {}'.format(errors))
OUTPUT:
ERRORS: warning: redirecting to https://gitlab.com/networkAutomation/git_test_module.git/
To https://gitlab.com/networkAutomation/git_test_module
afb2400..fbcb4db HEAD -> master