(shell_input)
Find characters used to escape from a string into a shell, and wrap them in
    quotes if they exist. Regex pilfered from Python3 :mod:`shlex` module.

    :param str shell_input: The input intended for the GnuPG process.
Find characters used to escape from a string into a shell, and wrap them in
    quotes if they exist. Regex pilfered from Python3 :mod:`shlex` module.
Find characters used to escape from a string into a shell and wrap them in quotes if they exist . Regex pilfered from Python3 : mod : shlex module .
def _fix_unsafe(shell_input):
    """Find characters used to escape from a string into a shell, and wrap them in
    quotes if they exist. Regex pilfered from Python3 :mod:`shlex` module.

    :param str shell_input: The input intended for the GnuPG process.
    """
    _unsafe = re.compile(r'[^\w@%+=:,./-]', 256)
    try:
        if len(_unsafe.findall(shell_input)) == 0:
            return shell_input.strip()
        else:
            clean = "'" + shell_input.replace("'", "'\"'\"'") + "'"
            return clean
    except TypeError:
        return None
def _fix_unsafe ( shell_input ) : _unsafe = re . compile ( r'[^\w@%+=:,./-]' , 256 ) try : if len ( _unsafe . findall ( shell_input ) ) == 0 : return shell_input . strip ( ) else : clean = "'" + shell_input . replace ( "'" , "'\"'\"'" ) + "'" return clean except TypeError : return None