Skip to content
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

vsdownload: Allow dest dir to contain spaces on Windows #160

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

huangqinjin
Copy link
Contributor

No description provided.

@@ -587,7 +587,8 @@ def unpackWin10SDK(src, payloads, dest):
print("Extracting " + name)
srcfile = os.path.join(src, name)
if sys.platform == "win32":
cmd = ["msiexec", "/a", srcfile, "/qn", "TARGETDIR=" + os.path.abspath(dest)]
# The path to TARGETDIR need to be quoted in the case of spaces.
cmd = "msiexec /a \"%s\" /qn TARGETDIR=\"%s\"" % (srcfile, os.path.abspath(dest))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, so is this a case where the python subprocess.check_call() taking an array cmd actually doesn't quote the individual arguments correctly when they contain spaces? (I know there are hairy corner cases when it comes to quoting of special characters, but for something as straightforward as regular spaces, I would have expected the usual array form to work.)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, for this change, it makes me think that it would be valuable to have CI testing using vsdownload.py on Windows too, to have test coverage of these codepaths. After downloading and unpacking, I wonder what trivial verification we could do on it though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants