def encodeExecutableAndArgs(executable, args, encoding='utf-8'):
 if isinstance(executable, text_type):
  executable = executable.encode(encoding)
 argsBytes = []
 for arg in args:
  if isinstance(arg, text_type):
   arg = arg.encode(encoding)
  argsBytes.append(arg)
 return (executable, argsBytes)

def encodeExecutableAndArgs ( executable , args , encoding = 'utf-8' ) : if isinstance ( executable , text_type ) : executable = executable . encode ( encoding ) argsBytes = [ ] for arg in args : if isinstance ( arg , text_type ) : arg = arg . encode ( encoding ) argsBytes . append ( arg ) return ( executable , argsBytes )
encode executable and arguments from unicode to bytes .