diff --git a/pygmt/figure.py b/pygmt/figure.py index d670a3bae51..767b9aded92 100644 --- a/pygmt/figure.py +++ b/pygmt/figure.py @@ -192,8 +192,6 @@ def psconvert(self, **kwargs): # Default cropping the figure to True if "A" not in kwargs: kwargs["A"] = "" - # allow for spaces in figure name - kwargs["F"] = f'"{kwargs.get("F")}"' if kwargs.get("F") else None with Session() as lib: lib.call_module("psconvert", build_arg_string(kwargs)) diff --git a/pygmt/tests/test_figure.py b/pygmt/tests/test_figure.py index 4ac5d4f0592..b596d2b33d4 100644 --- a/pygmt/tests/test_figure.py +++ b/pygmt/tests/test_figure.py @@ -116,6 +116,7 @@ def test_figure_savefig_filename_with_spaces(): fig.basemap(region=[0, 1, 0, 1], projection="X1c/1c", frame=True) with GMTTempFile(prefix="pygmt-filename with spaces", suffix=".png") as imgfile: fig.savefig(imgfile.name) + assert not r"\040" in os.path.abspath(imgfile.name) assert os.path.exists(imgfile.name)