hnesk/browse-ocrd

support path names with spaces

Closed this issue · 0 comments

When opening a workspace with spaces anywhere in the directory names, ocrd_browser fails:

browse-ocrd PRImA\ Layout\ Analysis\ Dataset/mets.xml
FileNotFoundError: File path passed as 'url' to download_to_directory does not exist: /daten/PRImA%20Layout%20Analysis%20Dataset/mets.xml

The cause is not on the OCR-D side AFAICS, but here:

mets_url = cls._strip_local(mets_url)

which in turn does

def _strip_local(mets_url: Union[Path, str], disallow_remote: bool = True) -> str:
result = urlparse(str(mets_url))