lib.Uri: Treat paths starting with ~" specially #48
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue