(self, args=None, passphrase=False)
return subprocess.Popen(cmd, shell=expand_shell, stdin=subprocess.PIPE,
                                stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                                env=environment)
Open a pipe to a GPG subprocess and return the file objects for
        communicating with it.

        :param list args: A list of strings of options and flags to pass to
                          ``GPG.binary``. This is input safe, meaning that
                          these values go through strict checks (see
                          ``parsers._sanitise_list``) before being passed to to
                          the input file descriptor for the GnuPG process.
                          Each string should be given exactly as it would be on
                          the commandline interface to GnuPG,
                          e.g. ["--cipher-algo AES256", "--default-key
                          A3ADB67A2CDB8B35"].

        :param bool passphrase: If True, the passphrase will be sent to the
                                stdin file descriptor for the attached GnuPG
                                process.
Open a pipe to a GPG subprocess and return the file objects for
        communicating with it.
Open a pipe to a GPG subprocess and return the file objects for communicating with it .
def _open_subprocess(self, args=None, passphrase=False):
        """Open a pipe to a GPG subprocess and return the file objects for
        communicating with it.

        :param list args: A list of strings of options and flags to pass to
                          ``GPG.binary``. This is input safe, meaning that
                          these values go through strict checks (see
                          ``parsers._sanitise_list``) before being passed to to
                          the input file descriptor for the GnuPG process.
                          Each string should be given exactly as it would be on
                          the commandline interface to GnuPG,
                          e.g. ["--cipher-algo AES256", "--default-key
                          A3ADB67A2CDB8B35"].

        :param bool passphrase: If True, the passphrase will be sent to the
                                stdin file descriptor for the attached GnuPG
                                process.
        """
        ## see http://docs.python.org/2/library/subprocess.html#converting-an\
        ##    -argument-sequence-to-a-string-on-windows
        cmd = shlex.split(' '.join(self._make_args(args, passphrase)))
        log.debug("Sending command to GnuPG process:%s%s" % (os.linesep, cmd))

        if platform.system() == "Windows":
            # TODO figure out what the hell is going on there.
            expand_shell = True
        else:
            expand_shell = False

        environment = {
            'LANGUAGE': os.environ.get('LANGUAGE') or 'en',
            'GPG_TTY': os.environ.get('GPG_TTY') or '',
            'DISPLAY': os.environ.get('DISPLAY') or '',
            'GPG_AGENT_INFO': os.environ.get('GPG_AGENT_INFO') or '',
            'GPG_TTY': os.environ.get('GPG_TTY') or '',
            'GPG_PINENTRY_PATH': os.environ.get('GPG_PINENTRY_PATH') or '',
        }

        return subprocess.Popen(cmd, shell=expand_shell, stdin=subprocess.PIPE,
                                stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                                env=environment)
def _open_subprocess ( self , args = None , passphrase = False ) : ## see http://docs.python.org/2/library/subprocess.html#converting-an\ ##    -argument-sequence-to-a-string-on-windows cmd = shlex . split ( ' ' . join ( self . _make_args ( args , passphrase ) ) ) log . debug ( "Sending command to GnuPG process:%s%s" % ( os . linesep , cmd ) ) if platform . system ( ) == "Windows" : # TODO figure out what the hell is going on there. expand_shell = True else : expand_shell = False environment = { 'LANGUAGE' : os . environ . get ( 'LANGUAGE' ) or 'en' , 'GPG_TTY' : os . environ . get ( 'GPG_TTY' ) or '' , 'DISPLAY' : os . environ . get ( 'DISPLAY' ) or '' , 'GPG_AGENT_INFO' : os . environ . get ( 'GPG_AGENT_INFO' ) or '' , 'GPG_TTY' : os . environ . get ( 'GPG_TTY' ) or '' , 'GPG_PINENTRY_PATH' : os . environ . get ( 'GPG_PINENTRY_PATH' ) or '' , } return subprocess . Popen ( cmd , shell = expand_shell , stdin = subprocess . PIPE , stdout = subprocess . PIPE , stderr = subprocess . PIPE , env = environment )