Skip to content

Commit 92f8e9a

Browse files
committed
Update filename change logic
1 parent 3cfad5e commit 92f8e9a

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/superannotate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import sys
33

4-
__version__ = "4.4.7b1"
4+
__version__ = "4.4.7b2"
55

66
sys.path.append(os.path.split(os.path.realpath(__file__))[0])
77

src/superannotate/lib/core/usecases/models.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os.path
33
import tempfile
44
import time
5+
import platform
56
import zipfile
67
from pathlib import Path
78
from typing import List
@@ -140,7 +141,8 @@ def execute(self):
140141

141142

142143
class DownloadExportUseCase(BaseReportableUseCase):
143-
FORBIDDEN_CHARS = "*./\[]:;|,\"\'"
144+
FORBIDDEN_CHARS = "*./\\[]:;|,\"'"
145+
144146
def __init__(
145147
self,
146148
service_provider: BaseServiceProvider,
@@ -206,9 +208,10 @@ def download_to_local_storage(self, destination: str, extract_zip=False):
206208
time.sleep(1)
207209
self.reporter.stop_spinner()
208210
filename = Path(export["path"]).stem
209-
for char in DownloadExportUseCase.FORBIDDEN_CHARS:
210-
filename=filename.replace(char, "_")
211-
filepath = Path(destination) / (filename+'.zip')
211+
if platform.system().lower() == "windows":
212+
for char in DownloadExportUseCase.FORBIDDEN_CHARS:
213+
filename = filename.replace(char, "_")
214+
filepath = Path(destination) / (filename + ".zip")
212215
with requests.get(export["download"], stream=True) as response:
213216
response.raise_for_status()
214217
with open(filepath, "wb") as f:

0 commit comments

Comments
 (0)