summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nitzo <nitzo2001@yahoo.com> 2016-01-09 22:05:19 +0100
committerGravatar Nitzo <nitzo2001@yahoo.com> 2016-01-09 22:05:19 +0100
commit2de11b92076493e2490c0fe5e476ce14d234f6b8 (patch)
tree30c59562ce8a7257e12763fd7f3f08d7fdb29767
parent[Hoster] fix #2275, #2277 (diff)
downloadpyload-2de11b92076493e2490c0fe5e476ce14d234f6b8.tar.xz
[Misc] fix safepath
-rw-r--r--module/plugins/internal/misc.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/module/plugins/internal/misc.py b/module/plugins/internal/misc.py
index 9b70c4b5a..f4491acf7 100644
--- a/module/plugins/internal/misc.py
+++ b/module/plugins/internal/misc.py
@@ -38,7 +38,7 @@ except ImportError:
class misc(object):
__name__ = "misc"
__type__ = "plugin"
- __version__ = "0.18"
+ __version__ = "0.19"
__status__ = "stable"
__pattern__ = r'^unmatchable$'
@@ -475,10 +475,13 @@ def truncate(name, length):
def safepath(value):
"""
Remove invalid characters and truncate the path if needed
+
+ @NOTE: Returns absolute path
"""
+ value = os.path.abspath(value)
drive, filename = os.path.splitdrive(value)
filename = os.path.join(os.sep, *map(safename, filename.split(os.sep)))
- path = os.path.abspath(drive + filename)
+ path = drive + filename
try:
if os.name != "nt":