Steps to reproduce:
- Create a project with a space in the name, e.g. "Test project"
- Run the following shell command on build: /usr/local/bin/python $WORKSPACE/build.py
- Run the build
- Receive following output as console output:
Started by timer Building in workspace /Users/Shared/Jenkins/Home/jobs/Test project/workspace [workspace] $ /bin/sh -xe /Users/Shared/Jenkins/tmp/hudson8678281940954009674.sh + /usr/local/bin/python /Users/Shared/Jenkins/Home/jobs/Test project/workspace/build.py /usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file '/Users/Shared/Jenkins/Home/jobs/Test': [Errno 2] No such file or directory Build step 'Execute shell' marked build as failure Finished: FAILURE
The space in "Test project" is not escaped and causes a failure.
Workaround is to rename the project to not contain spaces.
[JENKINS-29764] Can't run script from work directory of project with space names
Description |
Original:
Steps to reproduce: # Create a project with a space in the name, e.g. "Test project" # Run the following shell command on build: `/usr/local/bin/python $WORKSPACE/build.py` # Run the build # Receive following output as console output: {code:java} Started by timer Building in workspace /Users/Shared/Jenkins/Home/jobs/Test project/workspace [workspace] $ /bin/sh -xe /Users/Shared/Jenkins/tmp/hudson8678281940954009674.sh + /usr/local/bin/python /Users/Shared/Jenkins/Home/jobs/Test project/workspace/build.py /usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file '/Users/Shared/Jenkins/Home/jobs/Test': [Errno 2] No such file or directory Build step 'Execute shell' marked build as failure Finished: FAILURE {code} The space in "Test project" is not escaped and causes a failure. Workaround is to rename the project to not contain spaces. |
New:
Steps to reproduce: # Create a project with a space in the name, e.g. "Test project" # Run the following shell command on build: /usr/local/bin/python $WORKSPACE/build.py # Run the build # Receive following output as console output: {code:java} Started by timer Building in workspace /Users/Shared/Jenkins/Home/jobs/Test project/workspace [workspace] $ /bin/sh -xe /Users/Shared/Jenkins/tmp/hudson8678281940954009674.sh + /usr/local/bin/python /Users/Shared/Jenkins/Home/jobs/Test project/workspace/build.py /usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file '/Users/Shared/Jenkins/Home/jobs/Test': [Errno 2] No such file or directory Build step 'Execute shell' marked build as failure Finished: FAILURE {code} The space in "Test project" is not escaped and causes a failure. Workaround is to rename the project to not contain spaces. |
Resolution | New: Not A Defect [ 7 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Workflow | Original: JNJira [ 164840 ] | New: JNJira + In-Review [ 197557 ] |
Resolution | Original: Not A Defect [ 7 ] | |
Status | Original: Resolved [ 5 ] | New: Reopened [ 4 ] |
Resolution | New: Not A Defect [ 7 ] | |
Status | Original: Reopened [ 4 ] | New: Resolved [ 5 ] |
https://www.gnu.org/software/bash/manual/html_node/Word-Splitting.html#Word-Splitting