Skip to content

Commit 3f51f23

Browse files
committed
v0.3.9: *Actually* actually fixed URL concatenation
1 parent cc45684 commit 3f51f23

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

arya_api_framework/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
__author__ = 'Aryathel'
1010
__license__ = 'MIT'
1111
__copyright__ = '2022, Aryathel'
12-
__version__ = '0.3.8'
12+
__version__ = '0.3.9'
1313

1414
# Local modules
1515
from .async_framework import AsyncClient

arya_api_framework/async_framework/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ async def request(
307307
path = URL(path)
308308

309309
if not path.is_absolute():
310-
path = self.uri / path.human_repr()
310+
path = self.uri / path.human_repr().lstrip('/')
311311
else:
312312
path = self.uri
313313

arya_api_framework/framework.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,16 +1058,16 @@ def relative_path(self) -> Optional[URL]:
10581058
def full_relative_path(self) -> Optional[URL]:
10591059
if not self.parent or isinstance(self.parent, ClientInternal):
10601060
return self.relative_path
1061-
return self.parent.full_relative_path / self.relative_path.human_repr()
1061+
return self.parent.full_relative_path / self.relative_path.human_repr().lstrip('/')
10621062

10631063
@property
10641064
def qualified_path(self) -> Optional[URL]:
10651065
if not self.parent:
10661066
return
10671067
if isinstance(self.parent, ClientInternal):
1068-
return self.parent.uri / self.relative_path.human_repr()
1068+
return self.parent.uri / self.relative_path.human_repr().lstrip('/')
10691069
if self.parent.qualified_path:
1070-
return self.parent.qualified_path / self.relative_path.human_repr()
1070+
return self.parent.qualified_path / self.relative_path.human_repr().lstrip('/')
10711071

10721072
@property
10731073
def parent(self) -> Optional[Union[ClientT, SubClientT]]:
@@ -1193,7 +1193,7 @@ def request(
11931193
if isinstance(path, str):
11941194
path = URL(path)
11951195
if not path.is_absolute():
1196-
path = self.relative_path / path.human_repr()
1196+
path = self.relative_path / path.human_repr().lstrip('/')
11971197

11981198
if isinstance(self.parent, ClientInternal) and self.parent.branch == ClientBranch.async_:
11991199
return self.parent.request(
@@ -1313,7 +1313,7 @@ def upload_file(
13131313
if isinstance(path, str):
13141314
path = URL(path)
13151315
if not path.is_absolute():
1316-
path = self.relative_path / path.human_repr()
1316+
path = self.relative_path / path.human_repr().lstrip('/')
13171317

13181318
return self.parent.upload_file(
13191319
file,
@@ -1415,7 +1415,7 @@ def stream_file(
14151415
if isinstance(path, str):
14161416
path = URL(path)
14171417
if not path.is_absolute():
1418-
path = self.relative_path / path.human_repr()
1418+
path = self.relative_path / path.human_repr().lstrip('/')
14191419

14201420
return self.parent.stream_file(
14211421
file,
@@ -1511,7 +1511,7 @@ def get(
15111511
if isinstance(path, str):
15121512
path = URL(path)
15131513
if not path.is_absolute():
1514-
path = self.relative_path / path.human_repr()
1514+
path = self.relative_path / path.human_repr().lstrip('/')
15151515

15161516
return self.parent.get(
15171517
path,
@@ -1618,7 +1618,7 @@ def post(
16181618
if isinstance(path, str):
16191619
path = URL(path)
16201620
if not path.is_absolute():
1621-
path = self.relative_path / path.human_repr()
1621+
path = self.relative_path / path.human_repr().lstrip('/')
16221622

16231623
return self.parent.post(
16241624
path,
@@ -1727,7 +1727,7 @@ def patch(
17271727
if isinstance(path, str):
17281728
path = URL(path)
17291729
if not path.is_absolute():
1730-
path = self.relative_path / path.human_repr()
1730+
path = self.relative_path / path.human_repr().lstrip('/')
17311731

17321732
return self.parent.patch(
17331733
path,
@@ -1836,7 +1836,7 @@ def put(
18361836
if isinstance(path, str):
18371837
path = URL(path)
18381838
if not path.is_absolute():
1839-
path = self.relative_path / path.human_repr()
1839+
path = self.relative_path / path.human_repr().lstrip('/')
18401840

18411841
return self.parent.put(
18421842
path,
@@ -1945,7 +1945,7 @@ def delete(
19451945
if isinstance(path, str):
19461946
path = URL(path)
19471947
if not path.is_absolute():
1948-
path = self.relative_path / path.human_repr()
1948+
path = self.relative_path / path.human_repr().lstrip('/')
19491949

19501950
return self.parent.delete(
19511951
path,

arya_api_framework/sync_framework/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def request(
320320
path = URL(path)
321321

322322
if not path.is_absolute():
323-
path = self.uri / path.human_repr()
323+
path = self.uri / path.human_repr().lstrip('/')
324324
else:
325325
path = self.uri
326326
path = str(path)

0 commit comments

Comments
 (0)