The idea occurred to me when I want to use a tmp_file fixture from pytest for outPath, but it only accepts str because it calls len to sanitize outPath. I have to convert it to str.
As illustrated in PEP519, the type of outPath should be typing.Union[str, bytes, os.PathLike]. For our use case, I think str | os.PathLike should be fine (with from __future__ import annotations of course).
Converting str to Path will eliminate the need for sanitizing. Both onc.py and _util.py need to be changed.
The idea occurred to me when I want to use a
tmp_file
fixture from pytest foroutPath
, but it only acceptsstr
because it callslen
to sanitizeoutPath
. I have to convert it tostr
.As illustrated in PEP519, the type of outPath should be
typing.Union[str, bytes, os.PathLike]
. For our use case, I thinkstr | os.PathLike
should be fine (withfrom __future__ import annotations
of course).Converting str to Path will eliminate the need for sanitizing. Both onc.py and _util.py need to be changed.