From 095449adbae10423e65a2fa790618ebca73dab25 Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Tue, 7 Sep 2021 12:55:56 +1200 Subject: [PATCH] Remove workaround for spaces in fig.psconvert prefix Doesn't work yet, as the filename will contain the 040 octal code, but committing to have the diff available for review. --- pygmt/figure.py | 2 -- pygmt/tests/test_figure.py | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) 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)