From 0cad37f67f7f22db3a4b3537846f1e4a2c01585d Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Sat, 26 Aug 2023 10:52:13 +0200 Subject: [PATCH] Filepath over ssh should be wrapped in qoutes. This is relevant for files with spaces or special characters that we want interpreted as a single parameter. --- transatlanticTorrentExpress.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transatlanticTorrentExpress.py b/transatlanticTorrentExpress.py index b0dcd9e..8e3b94f 100755 --- a/transatlanticTorrentExpress.py +++ b/transatlanticTorrentExpress.py @@ -45,10 +45,10 @@ class File(): def fileSize(self): filePath = self.system.buildFilePath(self) - cmd = "du -hs '{}'".format(filePath.replace(' ', '\\ ')) + cmd = "du -hs '{}'".format(filePath) if self.system.remote: - cmd = 'ssh {}@{} {}'.format(self.system.user, self.system.host, cmd) + cmd = 'ssh {}@{} "{}"'.format(self.system.user, self.system.host, cmd) diskusageOutput = check_output(cmd, shell=True)