Martin Panter added the comment: I don’t understand what 2.7 has got to do with using subprocess or not. Jumping through a shell quoting hoop only to pass a command to the shell to be unquoted seems like double handling. This is how I might rewrite it (untested):
q_cmd = ("rpm", "-q", "--qf", r"%s %s\n" % (...), "--specfile", spec_path) with subprocess.Popen(q_cmd, stdout=PIPE, universal_newlines=?) as proc: for line in proc.stdout: ... if proc.returncode: raise DistutilsExecError(...) ---------- nosy: +martin.panter stage: -> patch review _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25627> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com