summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2019-05-21 22:25:03 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2020-10-26 20:56:24 +0530
commit0bc6719744f059634729d0bd8ccd1137267f9d94 (patch)
tree84155b1c4cf7719532065ba5b4e9d23ab3392c92
parent24896e12029b242a55f20318646e47318d31bfaa (diff)
cerbero/hacks: Don't blindly join args for os.path.join1.16.3
The code takes care to never append two absolute paths, for example. Instead, use Python's `join` and convert to posix paths before returning. Backport of https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/183 Fixes https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/301 Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/649>
-rw-r--r--cerbero/hacks.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cerbero/hacks.py b/cerbero/hacks.py
index 549649bf..11c40aad 100644
--- a/cerbero/hacks.py
+++ b/cerbero/hacks.py
@@ -18,6 +18,7 @@
import os
import sys
+import pathlib
### XML Hacks ###
@@ -64,7 +65,7 @@ oldrealpath = os.path.realpath
def join(*args):
- return '/'.join(args)
+ return pathlib.PurePath(oldjoin(*args)).as_posix()
def expanduser(path):