From d3abe2b3449104c16f7d8808e880b86ee6a1471d Mon Sep 17 00:00:00 2001 From: Andreas Poehlmann Date: Fri, 13 Oct 2023 00:19:26 +0200 Subject: [PATCH] upath: fix os.Pathlike support in get_upath_protocol --- upath/core312plus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upath/core312plus.py b/upath/core312plus.py index c477238c..5e7265d3 100644 --- a/upath/core312plus.py +++ b/upath/core312plus.py @@ -98,7 +98,7 @@ def get_upath_protocol( elif isinstance(pth, PurePath): pth_protocol = "" else: - raise TypeError(f"expected a str or PurePath instance, got: {pth!r}") + pth_protocol = split_upath_protocol(os.fspath(pth)) # if storage_options and not protocol: # protocol = "file" if protocol and pth_protocol and not pth_protocol.startswith(protocol):