Skip to content

Commit 9fc3986

Browse files
cam72cambsipocz
authored andcommitted
Fix an issue with some of the odd paths in our archive
1 parent bf3f199 commit 9fc3986

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

astroquery/mast/core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1335,8 +1335,10 @@ def _download_from_s3(self, dataProduct, localPath, cache=True):
13351335
# magic associations logic per Brian - 0-9/a-e we convert to 0
13361336
magicValues = "123456789abcde"
13371337
if obs_id[-1] in magicValues:
1338+
# We only replace the first occurrence in the folder
1339+
# The filename remains with the original obs_id as part of the name
13381340
new_obs_id = obs_id[:-1] + "0"
1339-
dataUri = dataUri.replace(obs_id, new_obs_id)
1341+
dataUri = dataUri.replace(obs_id, new_obs_id, 1)
13401342
obs_id = new_obs_id
13411343
log.warning("This data product's path may not have been properly identified %s" % dataUri)
13421344

0 commit comments

Comments
 (0)