SDK - Compiler - Fix incompatibility with python3.5 (#3122)

This commit is contained in:
Alexey Volkov 2020-02-19 13:55:47 -08:00 committed by GitHub
parent 4746bdbadd
commit 03e064cee2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -962,10 +962,11 @@ Please create a new issue at https://github.com/kubeflow/pipelines/issues attach
import subprocess
argo_path = shutil.which('argo')
if argo_path:
result = subprocess.run([argo_path, 'lint', '/dev/stdin'], input=yaml_text, encoding='utf-8', stdout=subprocess.PIPE, stderr=subprocess.PIPE)
result = subprocess.run([argo_path, 'lint', '/dev/stdin'], input=yaml_text.encode('utf-8'), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if result.returncode:
raise RuntimeError(
'''Internal compiler error: Compiler has produced Argo-incompatible workflow.
Please create a new issue at https://github.com/kubeflow/pipelines/issues attaching the pipeline code and the pipeline package.
Error: {}'''.format(result.stderr)
Error: {}'''.format(result.stderr.decode('utf-8'))
)