message: the asset upload script for releases was broken somehow
diff: @@ -3,7 +3,6 @@ import os
  import sys
  import glob
  import time
  -import mimetypes
  import urllib.request
  api_url = 'https://api.github.com/repos/duckdb/duckdb/'
  @@ -45,28 +44,28 @@ def gh_api(suburl, filename='', method='GET'):
  body_data = b''
  - print(f'GH API URL: "{url}" Filename: "{filename}" Method: "{method}"')
  + timeout = 1
  + nretries = 10
  + raw_resp = None
  + for i in range(nretries+1):
  + success = True
  + try:
  if len(filename) > 0:
  method = 'POST'
  body_data = open(filename, 'rb')
  -
  - mime_type = mimetypes.guess_type(local_filename)[0]
  - if mime_type is None:
  - mime_type = "application/octet-stream"
  - headers["Content-Type"] = mime_type
  + headers["Content-Type"] = "binary/octet-stream"
  headers["Content-Length"] = os.path.getsize(local_filename)
  -
  url = suburl # cough
  req = urllib.request.Request(url, body_data, headers)
  req.get_method = lambda: method
  - timeout = 1
  - nretries = 10
  - raw_resp = None
  - for i in range(nretries+1):
  - success = True
  - try:
  +
  + print(f'GH API URL: "{url}" Filename: "{filename}" Method: "{method}"')
  +
  raw_resp = urllib.request.urlopen(req).read().decode()
  + except urllib.error.HTTPError as e:
  + print(e.read().decode()) # gah
  + success = False
  except Exception as e:
  print(e)
  success = False
  @@ -92,6 +91,7 @@ resp = gh_api('releases/tags/%s' % tag)
  if 'id' not in resp or 'upload_url' not in resp:
  raise ValueError('release does not exist for tag ' % tag)
  +
  # double-check that release exists and has correct sha
  # disabled to not spam people watching releases
  # if 'id' not in resp or 'upload_url' not in resp or 'target_commitish' not in resp or resp['target_commitish'] != sha:
  @@ -119,7 +119,7 @@ for filename in files:
  if asset['name'] == asset_filename:
  gh_api('releases/assets/%s' % asset['id'], method='DELETE')
  - resp = gh_api(upload_url + '?name=%s' % asset_filename, filename=local_filename)
  + resp = gh_api(f'{upload_url}?name={asset_filename}', filename=local_filename)
  if 'id' not in resp:
  raise ValueError('upload failed :/ ' + str(resp))
  print("%s -> %s" % (local_filename, resp['browser_download_url']))
  