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

FindPythonForBuild (PCBuild) fails with a path that contains a space #92348

Closed
ariccio opened this issue May 5, 2022 · 3 comments
Closed

FindPythonForBuild (PCBuild) fails with a path that contains a space #92348

ariccio opened this issue May 5, 2022 · 3 comments
Labels
build The build process and cross-build OS-windows type-bug An unexpected behavior, bug, or error

Comments

@ariccio
Copy link
Contributor

ariccio commented May 5, 2022

Bug report
I discovered this while playing around building with VS 2022 (I know it's not supported yet).

FindPythonForBuild tries to execute a batch file (find_python.bat) and builds the path as such:

$(MSBuildThisFileDirectory)\find_python.bat

If you clone the CPython repo into a user profile Documents directory (as is the default for the GitHub frontend for windows), and your user profile contains a space, this script fails.

Locally changing the line to add encoded quotes like this works for me:

<Exec Command="&quot;$(MSBuildThisFileDirectory)\find_python.bat&quot; -q"

You could probably repro this by cloning into any directory with a space in the path.

Your environment

  • CPython versions tested on: latest main HEAD
  • Operating system and architecture: Windows 10
  • Visual Studio 2022
  • User profile name: Lucius Riccio (yes, I still have a hand-me-down :))

CC @zooba since I think he still owns this code? It looks like the PSF has moved to GitHub for issue tracking, it will take a few minutes for me to reconfigure everything locally to fork this properly if you want me to submit a one-line patch.

@ariccio ariccio added the type-bug An unexpected behavior, bug, or error label May 5, 2022
@eryksun eryksun added OS-windows build The build process and cross-build labels May 5, 2022
@zooba
Copy link
Member

zooba commented May 7, 2022

(There's no point tagging me directly - it only creates even more noise and I'm less likely to notice it. Just let the OS-windows tag do its job.)

That change looks fine. You can do it through GitHub's web UI easily enough if you don't want to fork locally. The CI build should be sufficient testing.

@ariccio
Copy link
Contributor Author

ariccio commented May 8, 2022

Ah! Very sorry. Didn't realize that's how you guys do that here! That makes sense, will do in the future!

Do I need to do that thing with a "news" note or can I just make the change in the web UI?

@zooba
Copy link
Member

zooba commented May 9, 2022

Nah, this doesn't require a NEWS entry. We'll set the tag that suppresses the check once the PR is there.

zooba added a commit to zooba/cpython that referenced this issue Jul 17, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 17, 2022
… in directory name (pythonGH-94925)

(cherry picked from commit 5c19dda)

Co-authored-by: Steve Dower <steve.dower@python.org>
miss-islington added a commit that referenced this issue Jul 17, 2022
…rectory name (GH-94925)

(cherry picked from commit 5c19dda)

Co-authored-by: Steve Dower <steve.dower@python.org>
@zooba zooba closed this as completed Jul 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build OS-windows type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants