The documentation mention that doit
accept Path
object inside file_dep
and targets
but I noticed that when I got the item back they're no longer Path
object but have been converted to string.
e.g:
#!/usr/bin/env python
# coding: utf-8
import pathlib
def task_path():
"""test"""
def mkdir(targets):
for directory in targets:
directory.mkdir()
return {
'actions': [mkdir],
'targets': [pathlib.Path('baz')],
'clean': True,
}
gives
% doit path
. path
TaskError - taskid:path
PythonAction Error
Traceback (most recent call last):
File "/home/sylvain/dev/doit_bug/partialfunc/venv/lib/python3.7/site-packages/doit/action.py", line 424, in execute
returned_value = self.py_callable(*self.args, **kwargs)
File "/home/sylvain/dev/doit_bug/order/dodo.py", line 25, in mkdir
directory.mkdir()
AttributeError: 'str' object has no attribute 'mkdir'
I would have expected the types to be preserved.
Is it a bug or do you have some internal constraints that force you to convert everything to string?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too