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.
This commit is contained in:
Matthieu Gautier 2024-08-26 17:41:50 +02:00
parent 940818d801
commit 4812fb18f6
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ class Resource:
for base_dir in base_dirs: for base_dir in base_dirs:
try: try:
with open(os.path.join(base_dir, filename), 'rb') as f: 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 found = True
break break
except FileNotFoundError: except FileNotFoundError: