mirror of
https://github.com/p2p-ld/numpydantic.git
synced 2024-11-14 02:34:28 +00:00
windows can't do <U as a path even hypothetically
This commit is contained in:
parent
2991d360e1
commit
d9f785efdd
2 changed files with 7 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue