Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workspace_from_url does not create destination directory #330

Closed
bertsky opened this issue Oct 10, 2019 · 1 comment
Closed

workspace_from_url does not create destination directory #330

bertsky opened this issue Oct 10, 2019 · 1 comment
Assignees
Labels

Comments

@bertsky
Copy link
Collaborator

bertsky commented Oct 10, 2019

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'
@bertsky bertsky added the bug label Oct 10, 2019
@bertsky bertsky added this to the Final workshop milestone Jan 7, 2020
@kba
Copy link
Member

kba commented Jan 9, 2020

Can reproduce, it's an issue with python 3.5's pathlib.

@kba kba closed this as completed in 06a34b0 Jan 10, 2020
kba added a commit that referenced this issue Jan 10, 2020
Resolver.workspace_from_url: Create dst_dir before resolve for py <= 3.5, fix #330
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants