From c4f935159ef2e12750a5036f57a5dcec7ed04191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Sat, 10 Jun 2017 11:08:04 +0200 Subject: [PATCH] Fix for when no temp dir was passed on the CLI --- bam/blend/blendfile_pack.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bam/blend/blendfile_pack.py b/bam/blend/blendfile_pack.py index 706b109..0c44d6d 100755 --- a/bam/blend/blendfile_pack.py +++ b/bam/blend/blendfile_pack.py @@ -645,6 +645,11 @@ def exclusion_filter(exclude: str): return filename_filter +def encode_none_safe(value: str): + if value is None: + return None + return value.encode('utf8') + def main(): parser = create_argparse() args = parser.parse_args() @@ -661,7 +666,7 @@ def main(): args.path_src.encode('utf8'), args.path_dst.encode('utf8'), mode=args.mode, - base_dir_dst_temp=args.temp_path.encode('utf8'), + base_dir_dst_temp=encode_none_safe(args.temp_path), filename_filter=exclusion_filter(args.exclude), ): report(msg)