lib.Uri: Return 'file' scheme for local paths
The scheme property returns 'file://' for local paths instead of 'file', causing scheme_plus_authority to produce 'file://://' with a triple slash.
Also fix the test to expect 'file' instead of 'file://'.
Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.80.2Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
7d8994bcfe
commit
62803a4a1b
2 changed files with 2 additions and 2 deletions
|
|
@ -63,7 +63,7 @@ class Uri:
|
|||
def scheme(self) -> str:
|
||||
ret = self.__p.scheme
|
||||
if not ret:
|
||||
return 'file://'
|
||||
return 'file'
|
||||
return ret
|
||||
|
||||
@cached_property
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ assert '<hidden>' in u.safe_full_with_username # safe version hides password
|
|||
|
||||
# Scheme defaults to file
|
||||
u = Uri('/local/path')
|
||||
assert u.scheme == 'file://'
|
||||
assert u.scheme == 'file'
|
||||
assert u.protocol == 'file'
|
||||
|
||||
# Pimp returns existing Uri unchanged
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue