Sanitize paths before packing

also use mode as a kw arg
This commit is contained in:
2014-12-19 01:57:11 +01:00
parent 871600312c
commit fc5a206686

View File

@@ -141,6 +141,10 @@ def pack(
from bam.utils.system import colorize 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 # first check args are OK
# fakeroot _cant_ start with a separator, since we prepend chars to it. # fakeroot _cant_ start with a separator, since we prepend chars to it.
assert((blendfile_src_dir_fakeroot is None) or assert((blendfile_src_dir_fakeroot is None) or
@@ -418,7 +422,7 @@ def main():
for msg in pack( for msg in pack(
args.path_src.encode('utf-8'), args.path_src.encode('utf-8'),
args.path_dst.encode('utf-8'), args.path_dst.encode('utf-8'),
args.mode, mode=args.mode,
): ):
report(msg) report(msg)