Skip to content

Commit a64ffa0

Browse files
committed
Replace backslashes on windows for obfuscated files
1 parent 25208d7 commit a64ffa0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/scanoss/winnowing.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"""
3030
import hashlib
3131
import pathlib
32+
import platform
3233
import re
3334

3435
from crc32c import crc32c
@@ -310,6 +311,8 @@ def wfp_for_contents(self, file: str, bin_file: bool, contents: bytes) -> str:
310311
wfp_filename = repr(file).strip("'") # return a utf-8 compatible version of the filename
311312
if self.obfuscate: # hide the real size of the file and its name, but keep the suffix
312313
wfp_filename = f'{self.ob_count}{pathlib.Path(file).suffix}'
314+
if platform.system() == 'Windows':
315+
wfp_filename = wfp_filename.replace('\\', '/')
313316
self.ob_count = self.ob_count + 1
314317
self.file_map[wfp_filename] = file # Save the file name map for later (reverse lookup)
315318

0 commit comments

Comments
 (0)