Skip to content

workspace_from_url does not create destination directory #330

@bertsky

Description

@bertsky

Related to #319, but independent: Resolver.workspace_from_url and in turn ocrd.cli.workspace.workspace_clone do not support cloning into a new directory. The cause seems to be using pathlib.Path.resolve() (presumably to get a symlink- and loop-free path string). This function requires the path to exist already.

Output from clone:

File ".pyenv/versions/3.5.3/envs/ocrd-3.5/lib/python3.5/site-packages/ocrd/cli/workspace.py", line 89, in workspace_clone
    download=download,
  File ".pyenv/versions/3.5.3/envs/ocrd-3.5/lib/python3.5/site-packages/ocrd/resolver.py", line 142, in workspace_from_url
    dst_dir = str(Path(dst_dir).resolve())
  File ".pyenv/versions/3.5.3/lib/python3.5/pathlib.py", line 1109, in resolve
    s = self._flavour.resolve(self)
  File ".pyenv/versions/3.5.3/lib/python3.5/pathlib.py", line 330, in resolve
    return _resolve(base, str(path)) or sep
  File ".pyenv/versions/3.5.3/lib/python3.5/pathlib.py", line 315, in _resolve
    target = accessor.readlink(newpath)
  File ".pyenv/versions/3.5.3/lib/python3.5/pathlib.py", line 422, in readlink
    return os.readlink(path)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/test-ocrd-olena-binarize'

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions