diff --git a/blueman/plugins/applet/TransferService.py b/blueman/plugins/applet/TransferService.py index 792b55bdc..1c5d3b27c 100644 --- a/blueman/plugins/applet/TransferService.py +++ b/blueman/plugins/applet/TransferService.py @@ -286,12 +286,14 @@ def _on_transfer_completed(self, _manager: Manager, transfer_path: str, success: dest_dir, ignored = self._make_share_path() filename = os.path.basename(src) - dest = os.path.join(dest_dir, filename) - if os.path.exists(dest): + if os.path.exists(os.path.join(dest_dir, filename)): now = datetime.now() filename = f"{now.strftime('%Y%m%d%H%M%S')}_{filename}" logging.info(f"Destination file exists, renaming to: {filename}") + dest = os.path.join(dest_dir, filename) + shutil.move(src, dest) + try: shutil.move(src, dest) except (OSError, PermissionError):