Fix offline mode to support python3.5

This commit is contained in:
allegroai 2020-08-08 12:47:08 +03:00
parent 2c68a188d9
commit de61dbf54e
4 changed files with 4 additions and 4 deletions

View File

@ -262,7 +262,7 @@ class Metrics(InterfaceBase):
remote_url = remote_url[:-1]
uploaded_files = set()
task_id = task.id
with open(filename, 'rt') as f:
with open(filename.as_posix(), 'rt') as f:
i = 0
while True:
try:

View File

@ -259,7 +259,7 @@ class TaskHandler(BufferingHandler):
filename = Path(folder) / cls.__offline_filename
if not filename.is_file():
return False
with open(filename, 'rt') as f:
with open(filename.as_posix(), 'rt') as f:
i = 0
while True:
try:

View File

@ -543,7 +543,7 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
if self._offline_mode:
# noinspection PyBroadException
try:
with open(self.get_offline_mode_folder() / self._offline_filename, 'rt') as f:
with open((self.get_offline_mode_folder() / self._offline_filename).as_posix(), 'rt') as f:
stored_dict = json.load(f)
stored_data = tasks.Task(**stored_dict)
# add missing entries

View File

@ -1710,7 +1710,7 @@ class Task(_Task):
raise ValueError("Could not find the session folder / zip-file {}".format(session_folder))
try:
with open(session_folder / cls._offline_filename, 'rt') as f:
with open((session_folder / cls._offline_filename).as_posix(), 'rt') as f:
export_data = json.load(f)
except Exception as ex:
raise ValueError(