Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
joein committed Nov 12, 2024
1 parent c5b100f commit 133eaff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def last_resort(func, path, exc_info):
print("content of parent", p, list(p.iterdir()))

import sys
import stat

def get_size(path: Path) -> int:
if path.is_file():
Expand All @@ -83,6 +84,10 @@ def get_size(path: Path) -> int:
return sum(f.stat().st_size for f in path.rglob("*") if f.is_file())
return 0

def get_permissions(path: Path) -> str:
mode = path.stat().st_mode
return stat.filemode(mode)

try:
print(sys.getwindowsversion())
path = Path("C:/Users/RUNNER~1/AppData/Local/Temp/fastembed_cache/")
Expand All @@ -91,5 +96,7 @@ def get_size(path: Path) -> int:
print(path)
size = get_size(path)
print(f"{path}: {size / (1024 * 1024):.2f} MB")
permissions = get_permissions(path)
print(f"{permissions} {path}")
except Exception:
print("Not windows")

0 comments on commit 133eaff

Please sign in to comment.