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

Accept action returned value of type pathlib.*Path as success #195

Open
vlcinsky opened this issue Sep 17, 2017 · 1 comment
Open

Accept action returned value of type pathlib.*Path as success #195

vlcinsky opened this issue Sep 17, 2017 · 1 comment

Comments

@vlcinsky
Copy link
Contributor

vlcinsky commented Sep 17, 2017

It is great, doit allows using pathlib.

Things like these are simple and easy:

import shutil
from pathlib import Path

src = Path("input/file.txt")
out = Path("output/file.txt")

res = shutil.copy(src, out)

The only problem is, that (with python 3.6) the res is of the same value as out and following action fails:

	{
		"actions": [
			(shutil.copy, [src, out]),
		],
	}

because value of type pathlib.PosixPath is not considered a sign of success.

There is a workaround (shutil.copy, [src, str(out)]) but as doit already acounts for use of pathlib, why not accept such values as sign of success.

Fund with Polar
@schettino72
Copy link
Member

makes sense. just needs a patch 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants