It would be better to use a form of subprocess that does not require shell parsing -- in other words, a form where you can pass command line arguments as a list rather than a string.  Then you won't have to apply the (inadequate) quoting for comments, or any other parameter.