Skip to content

Commit

Permalink
upath.local: support fsspec options in open
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-- committed Mar 3, 2024
1 parent c1fe486 commit 6ab929e
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions upath/implementations/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,17 @@ def open(
newline=None,
**fsspec_kwargs,
) -> IO[Any]:
return PosixPath.open(self, mode, buffering, encoding, errors, newline)
if fsspec_kwargs:
return super(LocalPath, self).open(
mode=mode,
buffering=buffering,
encoding=encoding,
errors=errors,
newline=newline,
**fsspec_kwargs,
)
else:
return PosixPath.open(self, mode, buffering, encoding, errors, newline)

if sys.version_info < (3, 12):

Expand Down Expand Up @@ -174,7 +184,17 @@ def open(
newline=None,
**fsspec_kwargs,
) -> IO[Any]:
return WindowsPath.open(self, mode, buffering, encoding, errors, newline)
if fsspec_kwargs:
return super(LocalPath, self).open(
mode=mode,
buffering=buffering,
encoding=encoding,
errors=errors,
newline=newline,
**fsspec_kwargs,
)
else:
return WindowsPath.open(self, mode, buffering, encoding, errors, newline)

if sys.version_info < (3, 12):

Expand Down

0 comments on commit 6ab929e

Please sign in to comment.