parameters: (self, input)
return_statement: return (self.PIPE, input)
docstring: Returns (stdin, string_to_communicate)
docstring_summary: Returns (stdin, string_to_communicate)
docstring_tokens: Returns ( stdin string_to_communicate )
function: def _compute_stdin(self, input):
          """Returns (stdin, string_to_communicate)"""
          # FIXME: We should be returning /dev/null for stdin
          # or closing stdin after process creation to prevent
          # child processes from getting input from the user.
          if not input:
              return (None, None)
          if hasattr(input, "read"):  # Check if the input is a file.
              return (input, None)  # Assume the file is in the right encoding.
  
          # Popen in Python 2.5 and before does not automatically encode unicode objects.
          # http://bugs.python.org/issue5290
          # See https://bugs.webkit.org/show_bug.cgi?id=37528
          # for an example of a regresion caused by passing a unicode string directly.
          # FIXME: We may need to encode differently on different platforms.
          if isinstance(input, unicode):
              input = input.encode(self._child_process_encoding())
          return (self.PIPE, input)
function_tokens: def _compute_stdin ( self , input ) : # FIXME: We should be returning /dev/null for stdin # or closing stdin after process creation to prevent # child processes from getting input from the user. if not input : return ( None , None ) if hasattr ( input , "read" ) : # Check if the input is a file. return ( input , None ) # Assume the file is in the right encoding. # Popen in Python 2.5 and before does not automatically encode unicode objects. # http://bugs.python.org/issue5290 # See https://bugs.webkit.org/show_bug.cgi?id=37528 # for an example of a regresion caused by passing a unicode string directly. # FIXME: We may need to encode differently on different platforms. if isinstance ( input , unicode ) : input = input . encode ( self . _child_process_encoding ( ) ) return ( self . PIPE , input )