Skip to content

Commit

Permalink
Merge pull request #2062 from willaerk/main
Browse files Browse the repository at this point in the history
Escape the pylib path when using it in a shell command
  • Loading branch information
jordansissel authored Dec 8, 2024
2 parents 13a3c69 + 5960c8c commit e6b83c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/fpm/package/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class FPM::Package::Python < FPM::Package
option "--setup-py-arguments", "setup_py_argument",
"Arbitrary argument(s) to be passed to setup.py",
:multivalued => true, :attribute_name => :python_setup_py_arguments,
:default => []
:default => []
option "--internal-pip", :flag,
"Use the pip module within python to install modules - aka 'python -m pip'. This is the recommended usage since Python 3.4 (2014) instead of invoking the 'pip' script",
:attribute_name => :python_internal_pip,
Expand Down Expand Up @@ -236,7 +236,7 @@ def load_package_info(setup_py)

output = ::Dir.chdir(setup_dir) do
tmp = build_path("metadata.json")
setup_cmd = "env PYTHONPATH=#{pylib}:$PYTHONPATH #{attributes[:python_bin]} " \
setup_cmd = "env PYTHONPATH=#{pylib.shellescape}:$PYTHONPATH #{attributes[:python_bin]} " \
"setup.py --command-packages=pyfpm get_metadata --output=#{tmp}"

if attributes[:python_obey_requirements_txt?]
Expand Down

0 comments on commit e6b83c4

Please sign in to comment.