From 4812fb18f6374eaafb98fca9bae075987c8ab436 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 26 Aug 2024 17:41:50 +0200 Subject: [PATCH] Ensure resources use `\n` as newline and not `\r\n` It appears that git on Windows replace `\n` with `\r\n` in the working tree. So compiled resources contain a extra `\r` and our tests are failing. --- scripts/kiwix-compile-resources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kiwix-compile-resources b/scripts/kiwix-compile-resources index 11391cce9..fca014e87 100755 --- a/scripts/kiwix-compile-resources +++ b/scripts/kiwix-compile-resources @@ -71,7 +71,7 @@ class Resource: for base_dir in base_dirs: try: with open(os.path.join(base_dir, filename), 'rb') as f: - self.data = f.read() + self.data = f.read().replace(b"\r\n", b"\n") found = True break except FileNotFoundError: