Skip to content

Escape the pylib path when using it in a shell command #2062

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

Merged
merged 1 commit into from
Dec 8, 2024

Conversation

willaerk
Copy link
Contributor

Ran into an error creating a deb package from a python package when the current working directory contains spaces.

{:timestamp=>"2024-05-16T15:17:42.793044+0000", :message=>"Process failed: /bin/bash failed (exit code 127). Full command was:[\"/bin/bash\", \"-c\", \"env PYTHONPATH=/var/lib/jenkins-swarm-client/workspace/publiq packages/packages/vendor/bundle/ruby/2.7.0/gems/fpm-1.15.1/lib/fpm/package:$PYTHONPATH python3 setup.py --command-packages=pyfpm get_metadata --output=/tmp/package-python-build-627893c057255449a6af5622973a2c6df56cf6dde757466135f518e6bcdc/metadata.json\"]", :level=>:error}

The pylib variable gets passed to a shell command unescaped which causes the problem.
Adding a simple .shellescape solves the problem locally.

@jordansissel
Copy link
Owner

Thank you for this improvement! The change looks good, and I'm glad it works for you :)

@jordansissel jordansissel merged commit e6b83c4 into jordansissel:main Dec 8, 2024
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