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

Fix errors that occurs when the path to python.exe includes space characters #52213

Merged
merged 1 commit into from
Oct 5, 2021

Conversation

homuler
Copy link
Contributor

@homuler homuler commented Oct 1, 2021

Currently, when PYTHON_BIN_PATH includes space characters, the following command will fail (on Windows).

Rem Assume that Python is installed to `C:\Program Files (x86)\Python`.
bazel build -c opt --action_env PYTHON_BIN_PATH="C://Program Files (x86)//Python//python.exe" //tensorflow/lite:framework
ERROR: An error occurred during the fetch of repository 'local_execution_config_python':
   Traceback (most recent call last):
        File "C:/users/homul/sources/tensorflow/third_party/py/python_configure.bzl", line 210, column 33, in _create_local_python_repository
                python_lib = _get_python_lib(repository_ctx, python_bin)
        File "C:/users/homul/sources/tensorflow/third_party/py/python_configure.bzl", line 130, column 21, in _get_python_lib
                result = execute(repository_ctx, [python_bin, "-c", cmd])
        File "C:/users/homul/sources/tensorflow/third_party/remote_config/common.bzl", line 230, column 13, in execute
                fail(
Error in fail: Repository command failed
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

This PR makes it sure that the command path will be quoted if it includes space characters.

@google-ml-butler google-ml-butler bot added the size:XS CL Change Size: Extra Small label Oct 1, 2021
@google-cla google-cla bot added the cla: yes label Oct 1, 2021
@gbaned gbaned self-assigned this Oct 1, 2021
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Oct 1, 2021
@google-ml-butler google-ml-butler bot added the awaiting review Pull request awaiting review label Oct 1, 2021
@allenlavoie allenlavoie requested review from angerson and removed request for allenlavoie October 1, 2021 15:57
Copy link
Contributor

@angerson angerson left a comment

Choose a reason for hiding this comment

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

Thanks!

PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer Oct 4, 2021
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Oct 4, 2021
@kokoro-team kokoro-team removed kokoro:force-run Tests on submitted change labels Oct 4, 2021
@copybara-service copybara-service bot merged commit 6cec23a into tensorflow:master Oct 5, 2021
@google-ml-butler google-ml-butler bot removed awaiting review Pull request awaiting review ready to pull PR ready for merge process labels Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes size:XS CL Change Size: Extra Small
Projects
PR Queue
  
Approved by Reviewer
Development

Successfully merging this pull request may close these issues.

None yet

4 participants