Careful, `shell=True` is dangerous. Doesn't it work without? If someone can manage to get an "evil string" into a document name, you have a shell injection. See warning here: https://docs.python.org/2.7/library/subprocess.html#frequently-used-arguments