Package: mat / 0.6.1-4

Revert-Improves-a-bit-portability.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From: intrigeri <intrigeri@boum.org>
Date: Sat, 18 Mar 2017 11:21:57 +0000
Origin: https://0xacab.org/mat/mat/commit/8f6303a1f26fe8dad83ba96ab8328dbdfa3af59a
Bug-Upstream: https://0xacab.org/mat/mat/issues/11526
Subject: Revert "Improves a bit portability"

This reverts commit d054e313d7d83ec0089f7e0efe6b8a988fe99b3a.

os.path.join is *not* suitable for concatenating parts of the basename of
a file.

Closes: #11526
---
 libmat/parser.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libmat/parser.py b/libmat/parser.py
index 2a82a25..1b58f87 100644
--- a/libmat/parser.py
+++ b/libmat/parser.py
@@ -51,7 +51,7 @@ class GenericParser(object):
     def create_backup_copy(self):
         """ Create a backup copy
         """
-        shutil.copy2(self.filename, os.path.join(self.filename, '.bak'))
+        shutil.copy2(self.filename, self.filename + '.bak')
 
     def do_backup(self):
         """ Keep a backup of the file if asked.
@@ -60,7 +60,7 @@ class GenericParser(object):
             but it greatly simplify new strippers implementation.
         """
         if self.backup:
-            shutil.move(self.filename, os.path.join(self.filename, '.bak'))
+            shutil.move(self.filename, self.filename + '.bak')
         else:
             mat.secure_remove(self.filename)
         shutil.move(self.output, self.filename)