diff --git a/eodatasets3/prepare/sentinel_l1_prepare.py b/eodatasets3/prepare/sentinel_l1_prepare.py index ee7fe531..e45d48ff 100644 --- a/eodatasets3/prepare/sentinel_l1_prepare.py +++ b/eodatasets3/prepare/sentinel_l1_prepare.py @@ -528,8 +528,6 @@ def main( dry_run: bool, index_to_odc: bool, ): - output_base = normalise_path(output_base) if output_base else None - if sys.argv[1] == "sentinel-l1c": warnings.warn( "Command name 'sentinel-l1c-prepare' is deprecated: remove the 'c', and use `sentinel-l1-prepare`" @@ -545,7 +543,10 @@ def main( if datasets_path: datasets = [ *datasets, - *(Path(p.strip()) for p in (datasets_path.read_text().splitlines())), + *( + normalise_path(p.strip()) + for p in (datasets_path.read_text().splitlines()) + ), ] _LOG.info(f"{len(datasets)} paths(s) to process using {workers} worker(s))") @@ -587,7 +588,6 @@ def find_jobs() -> Iterable[Job]: datasets, label="Preparing metadata", show_pos=True ) as progress: for i, input_path in enumerate(progress): - input_path = normalise_path(input_path) first = True for producer, ds_path, sibling_yaml_path in files_in_path(input_path): diff --git a/eodatasets3/ui.py b/eodatasets3/ui.py index a3707510..15138e9d 100644 --- a/eodatasets3/ui.py +++ b/eodatasets3/ui.py @@ -5,13 +5,15 @@ from urllib.parse import urljoin, urlparse import click +from datacube.utils.uris import normalise_path class PathPath(click.Path): - """A Click path argument that returns a pathlib Path, not a string""" + """ + A Click argument that returns a normalised (absolute) pathlib Path""" def convert(self, value, param, ctx): - return Path(super().convert(value, param, ctx)) + return Path(normalise_path(super().convert(value, param, ctx))) def uri_resolve(base: Union[str, Path], path: Optional[str]) -> str: