windows can't do <U as a path even hypothetically

This commit is contained in:
sneakers-the-rat 2024-10-11 00:09:27 -07:00
parent 2991d360e1
commit d9f785efdd
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D
2 changed files with 7 additions and 3 deletions

View file

@ -64,7 +64,7 @@ def _relativize_paths(
``relative_to`` directory, if provided in the context
"""
relative_to = Path(relative_to).resolve()
def _r_path(v: Any) -> Any:
if not isinstance(v, (str, Path)):
return v
@ -80,7 +80,7 @@ def _relativize_paths(
):
return v
return str(relative_path(path, relative_to))
except (TypeError, ValueError):
except (TypeError, ValueError, OSError):
return v
return _walk_and_apply(value, _r_path, skip)
@ -95,7 +95,7 @@ def _absolutize_paths(value: dict, skip: Iterable = tuple()) -> dict:
if not path.exists():
return v
return str(path.resolve())
except (TypeError, ValueError):
except (TypeError, ValueError, OSError):
return v
return _walk_and_apply(value, _a_path, skip)

View file

@ -3,6 +3,7 @@ Tests that should be applied to all interfaces
"""
import json
import pdb
from importlib.metadata import version
import dask.array as da
@ -98,6 +99,9 @@ def test_interface_roundtrip_json(dtype_by_interface, tmp_output_dir_func):
if "subclass" in dtype_by_interface.id.lower():
pytest.xfail()
if "str-str" in dtype_by_interface.id.lower():
pdb.set_trace()
array = dtype_by_interface.array(path=tmp_output_dir_func)
case = dtype_by_interface.model(array=array)