fix
This commit is contained in:
@@ -351,10 +351,13 @@ def uploadactivity(access_token, filename, description='',
|
||||
name='Rowsandall.com workout'):
|
||||
|
||||
data_gz = BytesIO()
|
||||
with open(filename, 'rb') as inF:
|
||||
s = inF.read()
|
||||
with gzip.GzipFile(fileobj=data_gz, mode="w") as gzf:
|
||||
gzf.write(s)
|
||||
try:
|
||||
with open(filename, 'rb') as inF:
|
||||
s = inF.read()
|
||||
with gzip.GzipFile(fileobj=data_gz, mode="w") as gzf:
|
||||
gzf.write(s)
|
||||
except FileNotFoundError:
|
||||
return 0
|
||||
|
||||
headers = {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user