Skip to content

Commit

Permalink
Use string substitution in normalized_channel_url
Browse files Browse the repository at this point in the history
Fixes #602.
  • Loading branch information
nkaretnikov committed Dec 17, 2023
1 parent 5e4e2e5 commit e892710
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion conda-store-server/conda_store_server/conda_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,13 @@ def download_repodata(
"https://repo.anaconda.com/pkgs/main"
)
}
normalized_channel_url = yarl.URL(channel) / "./"
# Note: this doesn't use the / operator to append the trailing / character
# because it's ignored on Windows. Instead, string substitution is used if
# the / character is not present
if channel.endswith("/"):
normalized_channel_url = yarl.URL(channel)
else:
normalized_channel_url = yarl.URL(f"{channel}/")
channel_url = channel_replacements.get(
str(normalized_channel_url), yarl.URL(channel)
)
Expand Down

0 comments on commit e892710

Please sign in to comment.