Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2023-05-17 17:51:56 +02:00
parent 0d478b96c7
commit 9cf0b20143
2 changed files with 10 additions and 8 deletions

View File

@@ -147,15 +147,17 @@ class StravaIntegration(SyncIntegration):
row.exporttotcx(tcxfilename, notes=newnotes)
if dozip:
gzfilename = tcxfilename+'.gz'
with open(tcxfilename, 'rb') as inF:
s = inF.read()
with gzip.GzipFile(gzfilename, 'wb') as outF:
outF.write(s)
try:
os.remove(tcxfilename)
except WindowError: # pragma: no cover
pass
with open(tcxfilename, 'rb') as inF:
s = inF.read()
with gzip.GzipFile(gzfilename, 'wb') as outF:
outF.write(s)
try:
os.remove(tcxfilename)
except WindowError: # pragma: no cover
pass
except FileNotFoundError:
return ''
return gzfilename

Binary file not shown.