mirror of https://github.com/kiwix/libkiwix.git
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:
parent
940818d801
commit
4812fb18f6
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue