From 97c917d9cc8804843b7aa28ee27f1bf8e7452dac Mon Sep 17 00:00:00 2001 From: Andreas Poehlmann Date: Fri, 26 Dec 2025 20:04:15 +0100 Subject: [PATCH 1/2] upath.implementations.http: adjust write error cases --- upath/implementations/http.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/upath/implementations/http.py b/upath/implementations/http.py index 166819f5..35fce8ce 100644 --- a/upath/implementations/http.py +++ b/upath/implementations/http.py @@ -10,6 +10,7 @@ from fsspec.asyn import sync +from upath import UnsupportedOperation from upath._stat import UPathStatResult from upath.core import UPath from upath.types import JoinablePathLike @@ -124,3 +125,26 @@ def resolve( break return resolved_path + + def mkdir( + self, + mode: int = 0o777, + parents: bool = False, + exist_ok: bool = False, + ) -> None: + raise UnsupportedOperation + + def unlink(self, missing_ok: bool = False) -> None: + raise UnsupportedOperation + + def write_bytes(self, data: bytes) -> int: + raise UnsupportedOperation("DataPath does not support writing") + + def write_text( + self, + data: str, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, + ) -> int: + raise UnsupportedOperation("DataPath does not support writing") From 695e739ed7db401cc81ef33ec563e2844c5169cf Mon Sep 17 00:00:00 2001 From: Andreas Poehlmann Date: Sun, 28 Dec 2025 15:13:08 +0100 Subject: [PATCH 2/2] upath.implementations.http: fix error handling on HTTPPath.touch --- upath/implementations/http.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/upath/implementations/http.py b/upath/implementations/http.py index 35fce8ce..02394375 100644 --- a/upath/implementations/http.py +++ b/upath/implementations/http.py @@ -126,6 +126,9 @@ def resolve( return resolved_path + def touch(self, mode: int = 0o666, exist_ok: bool = True) -> None: + raise UnsupportedOperation + def mkdir( self, mode: int = 0o777,