From f0c66013e3a6319ce133419235e9f0e4b5d5187a Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sun, 12 Aug 2012 18:25:03 +0000 Subject: [PATCH] * morituri/extern/task/gstreamer.py: * morituri/test/test_common_checksum.py: Protect backslashes in names. Fixes #89. --- ChangeLog | 6 ++++++ morituri/extern/task/gstreamer.py | 6 +++--- morituri/test/test_common_checksum.py | 5 +++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e273258..78f52dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-08-12 Thomas Vander Stichele + + * morituri/extern/task/gstreamer.py: + * morituri/test/test_common_checksum.py: + Protect backslashes in names. Fixes #89. + 2012-08-12 Thomas Vander Stichele * morituri/common/drive.py: diff --git a/morituri/extern/task/gstreamer.py b/morituri/extern/task/gstreamer.py index 1fa7491..4771348 100644 --- a/morituri/extern/task/gstreamer.py +++ b/morituri/extern/task/gstreamer.py @@ -26,10 +26,10 @@ def quoteParse(path): """ Quote a path for use in gst.parse_launch. """ - # Make sure double quotes are escaped. See - # morituri.test.test_common_checksum + # Make sure double quotes and backslashes are escaped. See + # morituri.test.test_common_checksum.NormalPathTestCase - return path.replace('"', '\\"') + return path.replace('"', '\\"').replace('\\', '\\\\') class GstException(Exception): diff --git a/morituri/test/test_common_checksum.py b/morituri/test/test_common_checksum.py index 23fc6cc..1c2d189 100644 --- a/morituri/test/test_common_checksum.py +++ b/morituri/test/test_common_checksum.py @@ -51,3 +51,8 @@ class NormalPathTestCase(PathTestCase): # This test makes sure we can checksum files with double quote in # their name self._testSuffix(u'morituri.test.12" edit') + + def testBackSlash(self): + # This test makes sure we can checksum files with a backslash in + # their name + self._testSuffix(u'morituri.test.40 Years Back\\Come')