Skip to content

Commit e2324ad

Browse files
authored
fix bug in lpath download(cache=True) (#525)
* fix bug in lpath download(cache=True) * fixes to api
1 parent 64779c5 commit e2324ad

File tree

4 files changed

+32
-17
lines changed

4 files changed

+32
-17
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Types of changes
1616

1717
# Latch SDK Changelog
1818

19+
## 2.56.5 - 2025-02-20
20+
21+
* Fix bug in `LPath` where `download` with `cache=True` set would fail on a file already present on the file system without the user.version_id xattr
22+
1923
## 2.56.5 - 2025-02-19
2024

2125
### Dependencies

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ include = ["src/**/*.py", "src/latch_cli/services/init/*"]
1212

1313
[project]
1414
name = "latch"
15-
version = "2.56.5"
15+
version = "2.56.6"
1616
description = "The Latch SDK"
1717
authors = [{ name = "Kenny Workman", email = "[email protected]" }]
1818
maintainers = [

src/latch/ldata/path.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import atexit
2-
import os
32
import re
43
import shutil
54
import sys
@@ -348,6 +347,8 @@ def download(
348347
not_windows
349348
and cache
350349
and dst.exists()
350+
and xattr.listxattr(dst_str) is not None
351+
and "user.version_id" in xattr.listxattr(dst_str)
351352
and version_id == xattr.getxattr(dst_str, "user.version_id").decode()
352353
):
353354
return dst

uv.lock

Lines changed: 25 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)