From fc5a206686c12b7253fab3d5ba8cb69f0aa79eae Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 19 Dec 2014 01:57:11 +0100 Subject: [PATCH] Sanitize paths before packing also use mode as a kw arg --- bam/blend/blendfile_pack.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bam/blend/blendfile_pack.py b/bam/blend/blendfile_pack.py index 15ceb24..9c6a4b2 100755 --- a/bam/blend/blendfile_pack.py +++ b/bam/blend/blendfile_pack.py @@ -141,6 +141,10 @@ def pack( from bam.utils.system import colorize + # in case this is directly from the command line or user-input + blendfile_src = os.path.normpath(os.path.abspath(blendfile_src)) + blendfile_dst = os.path.normpath(os.path.abspath(blendfile_dst)) + # first check args are OK # fakeroot _cant_ start with a separator, since we prepend chars to it. assert((blendfile_src_dir_fakeroot is None) or @@ -418,7 +422,7 @@ def main(): for msg in pack( args.path_src.encode('utf-8'), args.path_dst.encode('utf-8'), - args.mode, + mode=args.mode, ): report(msg)