Skip to content

fix relative paths for METS file#1353

Merged
kba merged 5 commits intoOCR-D:masterfrom
bertsky:fix-rel-mets-path
Feb 4, 2026
Merged

fix relative paths for METS file#1353
kba merged 5 commits intoOCR-D:masterfrom
bertsky:fix-rel-mets-path

Conversation

@bertsky
Copy link
Collaborator

@bertsky bertsky commented Jan 29, 2026

fixes #1213

@bertsky bertsky requested review from MehmedGIT and kba January 29, 2026 11:26
Copy link
Contributor

@MehmedGIT MehmedGIT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not tested separately with my ocrd network configuration when reviewing. However, if the workspace paths resolve correctly with your network configuration, that should be good enough to be merged. After the new core release, I will still have to verify with the Operandi setup afterwards.

EDIT: To fix the single failing error, it should suffice to just remove the first 6 characters from the test string in this line.

args=["ocrd", "workspace", "-U", f"{mets_server_url}", "-d", f"{ws_dir_path}", "server", "start"],
stdout=open(file=log_file, mode="w"), stderr=open(file=log_file, mode="a"), cwd=ws_dir_path,
stdout=open(file=log_file, mode="w"), stderr=open(file=log_file, mode="a"),
#cwd=ws_dir_path, # rs: if relative, this will cause wrong path resolution in the subprocess
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Potentially setting the current working directory to workspace directory path was the only way to make it work without changing/fixing the Workspace class itself or the workspace CLI. However, that had other side effects leading to a different bug.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, could well be. The workspace CLI was obviously not tested enough for the case WS ≠ WD.

In fixing add and bulk-add, I hope I caught that. (But should add tests also.)

What still remains are the long-standing issues with clone (#1149) and find --download (#809).

@kba kba merged commit beba88e into OCR-D:master Feb 4, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ocrd workspace: file paths should be made relative to self.directory

3 participants