Skip to content

Commit b1aa8ad

Browse files
LocalIdentityLocalIdentity
andauthored
Fix manifest script SHA HASH when files have different line endings (#2278)
Sometimes when someone is editing a file on their system, the line endings get mixed or change to a different system. PoB expects them to use CRLF so if you hash a file based on different line endings then it can result in the wrong hash and PoB will not download it We now use a regex to normalise all the lines before hashing so that we always get a CRLF hash Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 54b128b commit b1aa8ad

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

update_manifest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ def create_manifest(version: str | None = None, replace: bool = False) -> None:
102102
if exclude_dirs and _exclude_directory(exclude_dirs, path):
103103
continue
104104
data = path.read_bytes()
105+
# Normalize line endings for non-binary files in case they were accidentally mixed
106+
if b"\0" not in data:
107+
data = re.sub(rb"\r\n?|\n", b"\r\n", data)
105108
sha1 = hashlib.sha1(data).hexdigest()
106109
name = path.relative_to(config[section]["path"]).as_posix()
107110
attributes = (

0 commit comments

Comments
 (0)