Skip to content

Commit

Permalink
fix while receiving pasth as first arguments casting to string
Browse files Browse the repository at this point in the history
  • Loading branch information
petrus-v committed Aug 27, 2024
1 parent 77536a7 commit 66a6327
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/uri_pathlib_factory/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def load_uri_backends_from_plugins():
uri_backend_registry[scheme] = {
"purepath": PurePathClass,
"path": PathClass,
"params_adapter": params_adapter
if params_adapter
else default_params_adapter,
"params_adapter": (
params_adapter if params_adapter else default_params_adapter
),
}


Expand All @@ -64,7 +64,7 @@ def pathlib_factory_and_sanitize_args(cls, *args, **kwargs):
if args and issubclass(args[0].__class__, PurePath):
cls = args[0].__class__
if args and cls is Path or cls is PurePath:
parsed_uri = urlparse("/".join(args))
parsed_uri = urlparse("/".join([str(arg) for arg in args]))
uri_backend = uri_backend_registry.get(parsed_uri.scheme, None)
if uri_backend:
cls = uri_backend[cls.__name__.lower()]
Expand Down

0 comments on commit 66a6327

Please sign in to comment.