I have class for decrypting passwords like below:
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
Would anybody help me with how correct exception handling for subprocess look like in this case?