diff --git a/sdk/python/kfp/_client.py b/sdk/python/kfp/_client.py index 4e0f44fe74e..a5517fd6984 100644 --- a/sdk/python/kfp/_client.py +++ b/sdk/python/kfp/_client.py @@ -189,8 +189,7 @@ def _extract_pipeline_yaml(self, package_file): if len(all_yaml_files) > 1: raise ValueError('Invalid package. Multiple yaml files in the package.') - filename = zip.extract(all_yaml_files[0]) - with open(filename, 'r') as f: + with zip.open(all_yaml_files[0]) as f: return yaml.load(f) elif package_file.endswith('.yaml') or package_file.endswith('.yml'): with open(package_file, 'r') as f: