[SCM] morituri/master: * morituri/extern/task/gstreamer.py: * morituri/test/test_common_checksum.py: Protect backslashes in names. Fixes #89.

js at users.alioth.debian.org js at users.alioth.debian.org
Sun Oct 19 20:09:39 UTC 2014


The following commit has been merged in the master branch:
commit f0c66013e3a6319ce133419235e9f0e4b5d5187a
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Sun Aug 12 18:25:03 2012 +0000

    	* morituri/extern/task/gstreamer.py:
    	* morituri/test/test_common_checksum.py:
    	  Protect backslashes in names.  Fixes #89.

diff --git a/ChangeLog b/ChangeLog
index e273258..78f52dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2012-08-12  Thomas Vander Stichele  <thomas at apestaart dot org>
 
+	* morituri/extern/task/gstreamer.py:
+	* morituri/test/test_common_checksum.py:
+	  Protect backslashes in names.  Fixes #89.
+
+2012-08-12  Thomas Vander Stichele  <thomas at apestaart dot org>
+
 	* morituri/common/drive.py:
 	  If cdio.get_devices_with_cap finds a single drive, it returns a
 	  str instead of a list.  Work around that bug.  Fixes #102.
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')

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list