From e69e0f0c54f36af491a8eae040e9260bb60bd762 Mon Sep 17 00:00:00 2001 From: jobevers Date: Thu, 23 Feb 2017 12:11:05 -0600 Subject: [PATCH] flailing again - trying to upload from stdin --- release_on_tag.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/release_on_tag.py b/release_on_tag.py index d6d9539aa..b929070cd 100644 --- a/release_on_tag.py +++ b/release_on_tag.py @@ -130,15 +130,16 @@ def _curl_uploader(upload_uri, asset_to_upload, token): '-sS', '-X', 'POST', '-u', ':{}'.format(os.environ['GH_TOKEN']), - '--header', 'Content-Type: application/json', - '--data-binary', str('@{}'.format(asset_to_upload)), - str(upload_uri) + '--header', 'Content-Type: application/octet-stream', + '--data-binary', '@-', + upload_uri ] #'-d', '{"some_key": "some_value"}', print 'Calling curl:' print cmd print - p = subprocess.Popen(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE) + with open(asset_to_upload, 'rb') as fp: + p = subprocess.Popen(cmd, stdin=fp, stderr=subprocess.PIPE, stdout=subprocess.PIPE) stdout, stderr = p.communicate() print 'curl return code:', p.returncode if stderr: