-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix path separator-related bug affecting Windows #13631
Conversation
`get_target_info` expects a path-relative url string (https://url.spec.whatwg.org/#path-relative-url-string). `os.path.join` gives us the wrong separator (`\` instead of `/`). This changes that to use explicit concatenation to ensure the right separator is used.
Since we're mixing `\` and `/` anyway due to how some parts of the path are built manually and others with os.path.join, we can make testing easier by always returning the same format regardless of platform; this also makes the downloader's CLI-based API more consistent regardless of platform.
@@ -335,7 +339,7 @@ def _do_download(package, version=None, root_layout_type="core"): | |||
# -vvvv: INFO | |||
# -vvvvv: DEBUG | |||
cmd = [ | |||
"python", | |||
sys.executable, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this change was necessary so that it uses the right python
in Windows, otherwise it would be missing the dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
afaik this is also what the python docs recommend, so +1 on the change!
What does this PR do?
It fixes an errors on Windows caused by the use of a Windows path separator (
\
) where a/
is expected. It also enables Windows tests for the downloader on PR's to try to prevent future regressions.Motivation
Kitchen tests started to fail for windows, presumably due to #13331. E.g. https://gitlab.ddbuild.io/DataDog/datadog-agent/-/jobs/210470215):
It turns out we're not testing on Windows on CI, so this might have been caught before merge, but wasn't.
Additional Notes
Review checklist (to be filled by reviewers)
changelog/
andintegration/
labels attachedqa/skip-qa
label.