lib.Uri: Treat paths starting with ~" specially #48

Merged
Jan Lindemann merged 1 commit from jan/fix/20260722-lib-uri-treat-paths-starting-with-specially into master 2026-07-22 11:48:42 +02:00 AGit

View file

@ -17,6 +17,8 @@ class Uri:
self, scheme: bool, credentials: bool, secure: bool, path: bool
) -> str:
ret = ''
if self.__p.path.startswith('~'):
return self.path
if scheme:
ret += f'{self.protocol}://'
if credentials and self.username:
@ -62,7 +64,7 @@ class Uri:
@cached_property
def scheme(self) -> str:
ret = self.__p.scheme
if not ret:
if not ret and not self.__p.path.startswith('~'):
return 'file'
return ret