diff --git a/src/vorta/borg/borg_thread.py b/src/vorta/borg/borg_thread.py index 15aae39c..81a38791 100644 --- a/src/vorta/borg/borg_thread.py +++ b/src/vorta/borg/borg_thread.py @@ -42,9 +42,13 @@ class BorgThread(QtCore.QThread, BackupProfileMixin): self.app = QApplication.instance() self.app.backup_cancelled_event.connect(self.cancel) - extra_args = shlex.split(params.get('extra_borg_arguments', '')) cmd[0] = self.prepare_bin() - cmd = cmd[:2] + extra_args + cmd[2:] + + # Add extra Borg args to command. Never pass None. + extra_args_str = params.get('extra_borg_arguments') + if extra_args_str is not None and len(extra_args_str) > 0: + extra_args = shlex.split(extra_args_str) + cmd = cmd[:2] + extra_args + cmd[2:] env = os.environ.copy() env['BORG_HOSTNAME_IS_UNIQUE'] = '1' diff --git a/src/vorta/models.py b/src/vorta/models.py index 53e5dda8..b0f39796 100644 --- a/src/vorta/models.py +++ b/src/vorta/models.py @@ -42,7 +42,7 @@ class RepoModel(pw.Model): unique_csize = pw.IntegerField(null=True) total_size = pw.IntegerField(null=True) total_unique_chunks = pw.IntegerField(null=True) - extra_borg_arguments = pw.CharField(default='', null=True) + extra_borg_arguments = pw.CharField(default='') def is_remote_repo(self): return not self.url.startswith('/') @@ -332,4 +332,4 @@ def init_db(con): _apply_schema_update( current_schema, 12, migrator.add_column(RepoModel._meta.table_name, - 'extra_borg_arguments', pw.CharField(default='', null=True))) + 'extra_borg_arguments', pw.CharField(default=''))) diff --git a/src/vorta/views/extract_dialog.py b/src/vorta/views/extract_dialog.py index a5728067..3a13fe07 100644 --- a/src/vorta/views/extract_dialog.py +++ b/src/vorta/views/extract_dialog.py @@ -13,9 +13,9 @@ uifile = get_asset('UI/extractdialog.ui') ExtractDialogUI, ExtractDialogBase = uic.loadUiType(uifile) ISO_FORMAT = '%Y-%m-%dT%H:%M:%S.%f' -files_with_attributes = [] -nested_file_list = nested_dict() -selected_files_folders = set() +files_with_attributes = None +nested_file_list = None +selected_files_folders = None class ExtractDialog(ExtractDialogBase, ExtractDialogUI): @@ -24,6 +24,11 @@ class ExtractDialog(ExtractDialogBase, ExtractDialogUI): self.setupUi(self) global files_with_attributes, nested_file_list, selected_files_folders + # Clear global file lists + files_with_attributes = [] + nested_file_list = nested_dict() + selected_files_folders = set() + def parse_line(line): size, modified, full_path = line.split('\t') size = int(size) @@ -36,7 +41,7 @@ class ExtractDialog(ExtractDialogBase, ExtractDialogUI): return size, modified, name, dir - for l in fs_data.split('\n')[:-1]: + for l in fs_data.split('\n'): try: files_with_attributes.append(parse_line(l)) except ValueError: