From 19ce8969caffadc8f76bedb3457275dca76bdea8 Mon Sep 17 00:00:00 2001 From: Alex Pastel Date: Sat, 21 Dec 2024 20:25:59 -0700 Subject: [PATCH] fix(setup): Use resolve() before invoking as_uri() If a relative file path is provided, `as_uri()` throws a ValueError. Resolve the path to be absolute before converting to URI. --- ytmusicapi/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ytmusicapi/setup.py b/ytmusicapi/setup.py index 66731aff..cf6c24c8 100644 --- a/ytmusicapi/setup.py +++ b/ytmusicapi/setup.py @@ -75,7 +75,7 @@ def parse_args(args): def main() -> Union[RefreshingToken, str]: args = parse_args(sys.argv[1:]) filename = args.file.as_posix() if args.file else f"{args.setup_type}.json" - print(f"Creating {Path(filename).as_uri()} with your authentication credentials...") + print(f"Creating {Path(filename).resolve().as_uri()} with your authentication credentials...") if args.setup_type == "oauth": if args.client_id is None: args.client_id = input("Enter your Google Youtube Data API client ID: ")