diff --git a/src/stpipe/step.py b/src/stpipe/step.py index 7e780631..ca7c8cee 100644 --- a/src/stpipe/step.py +++ b/src/stpipe/step.py @@ -1377,7 +1377,7 @@ def build_config(cls, input, **kwargs): # noqa: A002 if "config_file" in kwargs: config_file = kwargs["config_file"] del kwargs["config_file"] - config_from_file = config_parser.load_config_file(config_file) + config_from_file = config_parser.load_config_file(str(config_file)) config_parser.merge_config(config, config_from_file) config_dir = os.path.dirname(config_file) else: diff --git a/tests/test_step.py b/tests/test_step.py index 6a7ee36a..d4bfe9f3 100644 --- a/tests/test_step.py +++ b/tests/test_step.py @@ -284,9 +284,13 @@ def test_step_list_args(config_file_list_arg_step): correctly. """ config, returned_config_file = ListArgStep.build_config( - "science.fits", config_file=str(config_file_list_arg_step) + "science.fits", config_file=config_file_list_arg_step ) - assert returned_config_file == str(config_file_list_arg_step) + assert returned_config_file == config_file_list_arg_step + + # Command line tests below need the config file path to be a string + returned_config_file = str(returned_config_file) + c, *_ = cmdline.just_the_step_from_cmdline( [ "filename.fits",