Skip to content

Commit

Permalink
[travis] Use Python 3.5 to avoid chunked uploads
Browse files Browse the repository at this point in the history
http.client defaults to chunked upload for files as of version 3.6, which
freaks out the github API because Content-Length is not set properly
  • Loading branch information
m-kuhn committed Nov 30, 2017
1 parent 9ceaa56 commit 3a4c96c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .deploy/create_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,20 @@ def main():
for release_file in release_files:
_, filename=os.path.split(release_file)
headers['Content-Type']='text/plain'
# headers['Transfer-Encoding']='gzip'
url='{release_url}?name={filename}'.format(release_url=release['upload_url'][:-13], filename=filename)
print('Upload to {}'.format(url))

with open(release_file, 'rb') as f:
conn.request('POST', url, f, headers)

conn.getresponse().read()
response = conn.getresponse()
result = response.read()
if response.status != 201:
print('Failed to upload filename {filename}'.format(filename=filename))
print('Github API replied:')
print('{} {}'.format(response.status, response.reason))
print(repr(json.loads(result.decode())))


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: python

python:
- 3.6
- 3.5

# run on Travis container-based infrastructure
dist: trusty
Expand Down

0 comments on commit 3a4c96c

Please sign in to comment.