From 584cc47fb31c3f312779185a7532c6e0c0ce48d0 Mon Sep 17 00:00:00 2001 From: Stephen Sachs Date: Thu, 28 Jul 2022 11:24:19 +0200 Subject: Fix parsing of clean_url (#31783) In #31618 the idea was to determine the file extension heuristically by dropping query params etc from a url and then consider it as a file path. That broke for URLs that only have query params like http://example.com/?patch=x as it would result in empty string as basename. This PR reverts to the old behavior of saving files as ?patch=x in that case. Co-authored-by: Stephen Sachs --- lib/spack/spack/stage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py index e995716f6e..a5d29f2917 100644 --- a/lib/spack/spack/stage.py +++ b/lib/spack/spack/stage.py @@ -366,9 +366,9 @@ class Stage(object): fnames = [] expanded = True if isinstance(self.default_fetcher, fs.URLFetchStrategy): - url_path = url_util.parse(self.default_fetcher.url).path expanded = self.default_fetcher.expand_archive - clean_url = os.path.basename(sup.sanitize_file_path(url_path)) + clean_url = os.path.basename( + sup.sanitize_file_path(self.default_fetcher.url)) fnames.append(clean_url) if self.mirror_paths: -- cgit v1.2.3-60-g2f50