From 62803a4a1bb524238f0cce317aa3e141706ff72b Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Wed, 1 Jul 2026 16:03:24 +0200 Subject: [PATCH] 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.2 Signed-off-by: Jan Lindemann --- src/python/jw/pkg/lib/Uri.py | 2 +- test/unit/python/jw/pkg/lib/Uri/test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python/jw/pkg/lib/Uri.py b/src/python/jw/pkg/lib/Uri.py index 13e7d1a5..fa48245d 100644 --- a/src/python/jw/pkg/lib/Uri.py +++ b/src/python/jw/pkg/lib/Uri.py @@ -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 diff --git a/test/unit/python/jw/pkg/lib/Uri/test.py b/test/unit/python/jw/pkg/lib/Uri/test.py index c88fe364..a435b8b2 100644 --- a/test/unit/python/jw/pkg/lib/Uri/test.py +++ b/test/unit/python/jw/pkg/lib/Uri/test.py @@ -19,7 +19,7 @@ assert '' 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