title: Python subprocess correct exceptoion handling
body: <p>I have class for decrypting passwords like below:</p>
  
  <pre><code>class Decrypt:
      def __init__(self, password):
      self.password = password
  
      def decrypt_file(self):
          command = "perl -e \'require \"Utilities.pm\";  print my $pass = Utilities::Decrypt(\"E\", \"{}\")\';".format(self.password)
          process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)
          output, error = process.communicate()
          return output
  </code></pre>
  
  <p>Would anybody help me with how correct exception handling for subprocess look like in this case?</p>