Explorar o código

compute OS-independent hash (fixes #1301)

Falko Schindler hai 1 ano
pai
achega
d9186abc7d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      nicegui/helpers.py

+ 1 - 1
nicegui/helpers.py

@@ -57,7 +57,7 @@ def is_file(path: Optional[Union[str, Path]]) -> bool:
 
 
 def hash_file_path(path: Path) -> str:
-    return hashlib.sha256(str(path).encode()).hexdigest()[:32]
+    return hashlib.sha256(path.as_posix().encode()).hexdigest()[:32]
 
 
 def safe_invoke(func: Union[Callable[..., Any], Awaitable], client: Optional['Client'] = None) -> None: