diff -r 1412be96faf0 Lib/distutils/command/bdist_rpm.py --- a/Lib/distutils/command/bdist_rpm.py Sat Nov 14 15:42:17 2015 +0200 +++ b/Lib/distutils/command/bdist_rpm.py Sat Nov 14 23:01:21 2015 +0100 @@ -3,6 +3,7 @@ Implements the Distutils 'bdist_rpm' command (create RPM source and binary distributions).""" +import shlex import subprocess, sys, os from distutils.core import Command from distutils.debug import DEBUG @@ -339,7 +340,7 @@ src_rpm = nvr_string + ".src.rpm" non_src_rpm = "%{arch}/" + nvr_string + ".%{arch}.rpm" q_cmd = r"rpm -q --qf '%s %s\n' --specfile '%s'" % ( - src_rpm, non_src_rpm, spec_path) + src_rpm, non_src_rpm, shlex.quote(spec_path)) out = os.popen(q_cmd) try: