From 0f4a46093e6da81942ccfe2150ca31d6bcea88f0 Mon Sep 17 00:00:00 2001 From: Sebastian Parborg Date: Mon, 21 Jul 2025 12:35:08 +0200 Subject: [PATCH] Fix: Properly package unicode folders/files with make_source_archive.py The issue was that `git ls-files` will per default escape unicode characters. This make it so that our python script couldn't find any files or folder as it expected unescaped characters. --- build_files/utils/make_source_archive.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build_files/utils/make_source_archive.py b/build_files/utils/make_source_archive.py index 4cbada12781..78f42a044a3 100755 --- a/build_files/utils/make_source_archive.py +++ b/build_files/utils/make_source_archive.py @@ -286,7 +286,7 @@ def git_ls_files(directory: Path = Path(".")) -> Iterable[Path]: Only lines that are actually files (so no directories, sockets, etc.) are returned, and never one from SKIP_NAMES. """ - for line in git_command(f"-C '{directory}' ls-files"): + for line in git_command(f"-C '{directory}' ls-files -z", "\x00"): path = directory / line if not path.is_file() or path.name in SKIP_NAMES: continue @@ -294,7 +294,7 @@ def git_ls_files(directory: Path = Path(".")) -> Iterable[Path]: yield path -def git_command(cli_args: str) -> Iterable[str]: +def git_command(cli_args: str, split_char="\n") -> Iterable[str]: """Generator, yields lines of output from a Git command.""" command = "git " + cli_args @@ -304,7 +304,7 @@ def git_command(cli_args: str) -> Iterable[str]: git = subprocess.run( command, stdout=subprocess.PIPE, shell=True, check=True, text=True, timeout=30 ) - for line in git.stdout.split("\n"): + for line in git.stdout.split(split_char): if line: yield line