From 60cf16e5ae1ef2ab835417eadbb1ccce49ece8ea Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Fri, 6 Dec 2024 09:09:06 -0700 Subject: [PATCH] URL quote the config directory for URI test This can be necessary if there are special characters in the parent path. --- tests/test_simpleButler.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_simpleButler.py b/tests/test_simpleButler.py index 1ffa7941ee..d3364d7af1 100644 --- a/tests/test_simpleButler.py +++ b/tests/test_simpleButler.py @@ -32,6 +32,7 @@ import re import tempfile import unittest +import urllib.parse from typing import Any try: @@ -899,8 +900,9 @@ def test_dataset_uris(self): ref = butler.find_dataset("flat", detector=2, physical_filter="Cam1-G") self.assertIsInstance(ref, DatasetRef) - # Get the butler root for the URI. - config_dir = butler._config["root"] + # Get the butler root for the URI. It does have to be encoded + # in case there are special characters in the path. + config_dir = urllib.parse.quote(butler._config["root"]) # Read it via a repo label and a path. with tempfile.NamedTemporaryFile(mode="w", suffix=".yaml") as index_file: