Skip to content

[Fix] Fix download function#67

Merged
lucas-diedrich merged 4 commits into
mainfrom
fix/download
Jun 11, 2026
Merged

[Fix] Fix download function#67
lucas-diedrich merged 4 commits into
mainfrom
fix/download

Conversation

@lucas-diedrich

@lucas-diedrich lucas-diedrich commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

[Manual fix, summary generated by Claude]

Problem

The download-dependent tests (test_glyphs, test_segmentation_loader) fail in CI with:

  FileNotFoundError: [Errno 2] No such file or directory:
    '.../pylmd_tmp_xxxxxxxxxx.lock'

The traceback points at src/lmd/_utils.py:111, after the download has completed successfully (the progress bar reaches 100%).

Root cause

_download wraps the download in a with FileLock(lock_path): block, but then also calls Path(lock_path).unlink() manually to clean up the lock file. FileLock manages the lifecycle of its own .lock file, and with the filelock version resolved in CI the lock file is already gone once the context manager exits. The unguarded unlink() therefore raises FileNotFoundError.

Fix

Make the cleanup tolerant of an already-removed lock file, consistent with the early-return path

@lucas-diedrich lucas-diedrich added the bug Something isn't working label Jun 10, 2026
[Fix] Round points instead of flooring
@lucas-diedrich lucas-diedrich merged commit 176f506 into main Jun 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants