From ea113cbf4a9b0d8ded3d7e429a8b24b07bced5e3 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Fri, 26 Feb 2021 11:30:49 +1000 Subject: [PATCH] [processing][gdal] ";" characters must be escaped when running gdal commands --- python/plugins/processing/algs/gdal/GdalUtils.py | 2 +- python/plugins/processing/tests/GdalAlgorithmsGeneralTest.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/plugins/processing/algs/gdal/GdalUtils.py b/python/plugins/processing/algs/gdal/GdalUtils.py index ea06b9f5ea1..1fbf41c60a6 100644 --- a/python/plugins/processing/algs/gdal/GdalUtils.py +++ b/python/plugins/processing/algs/gdal/GdalUtils.py @@ -250,7 +250,7 @@ class GdalUtils: @staticmethod def escapeAndJoin(strList): - escChars = [' ', '&', '(', ')', '"'] + escChars = [' ', '&', '(', ')', '"', ';'] joined = '' for s in strList: if not isinstance(s, str): diff --git a/python/plugins/processing/tests/GdalAlgorithmsGeneralTest.py b/python/plugins/processing/tests/GdalAlgorithmsGeneralTest.py index 94d09214e3c..d9c7a668fd5 100644 --- a/python/plugins/processing/tests/GdalAlgorithmsGeneralTest.py +++ b/python/plugins/processing/tests/GdalAlgorithmsGeneralTest.py @@ -338,7 +338,7 @@ class TestGdalAlgorithms(unittest.TestCase): self.assertEqual(GdalUtils.gdal_crs_string(QgsCoordinateReferenceSystem('ESRI:102003')), 'ESRI:102003') def testEscapeAndJoin(self): - self.assertEqual(GdalUtils.escapeAndJoin([1, "a", "a b", "a&b", "a(b)"]), '1 a "a b" "a&b" "a(b)"') + self.assertEqual(GdalUtils.escapeAndJoin([1, "a", "a b", "a&b", "a(b)", ";"]), '1 a "a b" "a&b" "a(b)" ";"') if __name__ == '__main__':