diff --git a/PyReconstruct/modules/gui/main/main_window.py b/PyReconstruct/modules/gui/main/main_window.py index 0c8bf56f..4818b730 100644 --- a/PyReconstruct/modules/gui/main/main_window.py +++ b/PyReconstruct/modules/gui/main/main_window.py @@ -411,7 +411,7 @@ def srcToZarr(self, create_new=True): str(zarr_converter.absolute()), "convert_zarr", str(cores), - f"\"{self.series.src_dir}\"", + self.series.src_dir, zarr_fp ] @@ -421,19 +421,20 @@ def srcToZarr(self, create_new=True): str(zarr_converter.absolute()), "convert_zarr", str(cores), - f"\"{self.series.src_dir}\"" + self.series.src_dir ] + # Pass argv as a list on every platform, never through a shell, so paths + # read from the series file stay single literal arguments. if os.name == 'nt': subprocess.Popen( convert_cmd, creationflags=subprocess.CREATE_NO_WINDOW ) - + else: - convert_cmd = " ".join(convert_cmd) - subprocess.Popen(convert_cmd, shell=True, stdout=None, stderr=None) + subprocess.Popen(convert_cmd, stdout=None, stderr=None) def changeUsername(self, new_name : str = None): """Edit the login name used to track history. @@ -1997,7 +1998,7 @@ def exportToZarr(self): convert_cmd = launch_prefix + [ str(zarr_converter.absolute()), "create_ng_zarr", - f"\"{self.series.jser_fp}\"" + self.series.jser_fp ] for argname, arg in args.items(): @@ -2010,24 +2011,25 @@ def exportToZarr(self): convert_cmd += [ "--output", - f"\"{arg}\"" + str(arg) ] - + else: convert_cmd += [argname] + str(arg).split() + # Pass argv as a list on every platform, never through a shell, so paths + # read from the series file stay single literal arguments. if os.name == 'nt': subprocess.Popen( convert_cmd, creationflags=subprocess.CREATE_NO_WINDOW ) - + else: - convert_cmd = " ".join(convert_cmd) - subprocess.Popen(convert_cmd, shell=True, stdout=None, stderr=None) + subprocess.Popen(convert_cmd, stdout=None, stderr=None) # AUTOSEG FUNCTIONS TEMPORARILY REMOVED