flailing again - trying to upload from stdin
This commit is contained in:
parent
250ed2bd6a
commit
e69e0f0c54
1 changed files with 5 additions and 4 deletions
|
@ -130,15 +130,16 @@ def _curl_uploader(upload_uri, asset_to_upload, token):
|
||||||
'-sS',
|
'-sS',
|
||||||
'-X', 'POST',
|
'-X', 'POST',
|
||||||
'-u', ':{}'.format(os.environ['GH_TOKEN']),
|
'-u', ':{}'.format(os.environ['GH_TOKEN']),
|
||||||
'--header', 'Content-Type: application/json',
|
'--header', 'Content-Type: application/octet-stream',
|
||||||
'--data-binary', str('@{}'.format(asset_to_upload)),
|
'--data-binary', '@-',
|
||||||
str(upload_uri)
|
upload_uri
|
||||||
]
|
]
|
||||||
#'-d', '{"some_key": "some_value"}',
|
#'-d', '{"some_key": "some_value"}',
|
||||||
print 'Calling curl:'
|
print 'Calling curl:'
|
||||||
print cmd
|
print cmd
|
||||||
print
|
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()
|
stdout, stderr = p.communicate()
|
||||||
print 'curl return code:', p.returncode
|
print 'curl return code:', p.returncode
|
||||||
if stderr:
|
if stderr:
|
||||||
|
|
Loading…
Add table
Reference in a new issue