Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix cache condition for local file #56

Merged
merged 2 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion minato/filesystems/osfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def delete(self) -> None:
remove_file_or_directory(self._path)

def get_version(self) -> str | None:
return None
return str(self._path.stat().st_mtime_ns)

@overload
def open_file(
Expand Down
2 changes: 1 addition & 1 deletion minato/minato.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def cached_path(

if is_local(url_or_filename):
url_or_filename = extract_path(url_or_filename)
if not extract and not is_archive_file(url_or_filename):
if not (extract and is_archive_file(url_or_filename)):
local_path = Path(url_or_filename)
if not local_path.exists():
raise FileNotFoundError(local_path)
Expand Down