code: 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
docs: 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.