Skip to content

Commit 3fd061c

Browse files
authored
upath.implementations.github: adjust GitHubPath error reporting (#522)
1 parent ef8888a commit 3fd061c

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

upath/implementations/github.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from collections.abc import Sequence
99
from typing import TYPE_CHECKING
1010

11+
from upath.core import UnsupportedOperation
1112
from upath.core import UPath
1213
from upath.types import JoinablePathLike
1314

@@ -56,3 +57,29 @@ def parts(self) -> Sequence[str]:
5657
return parts[1:]
5758
else:
5859
return parts
60+
61+
def touch(self, mode: int = 0o666, exist_ok: bool = True) -> None:
62+
raise UnsupportedOperation
63+
64+
def mkdir(
65+
self,
66+
mode: int = 0o777,
67+
parents: bool = False,
68+
exist_ok: bool = False,
69+
) -> None:
70+
raise UnsupportedOperation
71+
72+
def unlink(self, missing_ok: bool = False) -> None:
73+
raise UnsupportedOperation
74+
75+
def write_bytes(self, data: bytes) -> int:
76+
raise UnsupportedOperation
77+
78+
def write_text(
79+
self,
80+
data: str,
81+
encoding: str | None = None,
82+
errors: str | None = None,
83+
newline: str | None = None,
84+
) -> int:
85+
raise UnsupportedOperation("GitHubPath does not support writing")

0 commit comments

Comments
 (0)