diff --git a/internals/translationunitcache.py b/internals/translationunitcache.py index f8539a8..5c2fac1 100644 --- a/internals/translationunitcache.py +++ b/internals/translationunitcache.py @@ -26,7 +26,8 @@ from .common import Worker, complete_path, expand_path, get_setting, get_path_setting,\ get_language, LockedVariable, run_in_main_thread, error_message,\ - display_user_selection, get_cpu_count, status_message, bencode, bdecode, are_we_there_yet + display_user_selection, get_cpu_count, status_message, bencode, bdecode,\ + sencode, sdecode, are_we_there_yet from .clang import cindex from .parsehelp.parsehelp import * @@ -1251,14 +1252,14 @@ def get_translation_unit(self, filename, opts=[], opts_script=None, unsaved_file if opts_script: # shlex.split barfs if fed with an unicode strings - args = shlex.split(opts_script.encode()) + [filename] + args = shlex.split(sencode(opts_script)) + [filename] process = subprocess.Popen(args, stderr=subprocess.PIPE, stdout=subprocess.PIPE) output = process.communicate() if process.returncode: print("The options_script failed with code [%s]" % process.returncode) print(output[1]) else: - opts += shlex.split(output[0]) + opts += shlex.split(bdecode(output[0])) if self.debug_options: print("Will compile file %s with the following options:\n%s" % (filename, opts))