title: TypeError: __init__() got an unexpected keyword argument 'output' -- in a comment stripper program
body: <p>So my program's basic intention is to take comments out of C files and display them.</p>
  
  <pre><code>import urllib2
  import html2text
  import re
  import subprocess
  from cStringIO import StringIO
  
  url = raw_input('Please input URL youd like to analyze: ')
  page = urllib2.urlopen(url)
  html_content = page.read().decode('utf8')
  rendered_content =
  html2text.html2text(html_content).encode('ascii','ignore')
  
  f = open('file_text.txt', 'wb')
  f.write(rendered_content)
  f.close()
  
  fd = open("file_text.txt", "r")
  buf = fd.read()
  
  def comment_remover(text):
      def replacer(match):
          s = match.group(0)
              if s.startswith('/'):
                  return " "
              else:
                  return s
  
      pattern = re.compile(
          #Stackoverflow- properly removes all comments
          r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
          re.DOTALL | re.MULTILINE
      )
      return re.sub(pattern, replacer, text)
  
      input = StringIO(comment_remover(buf)) # source_code is a string with the source code.
      output = StringIO()
  
      process = subprocess.Popen(['sed', '/path/to/remccoms3.sed'], input=input, output=output)
      return_code = process.wait()
  
      stripped_code = output.getvalue()
  </code></pre>
  
  <p>Here's where I get the error message:</p>
  
  <pre><code>from linecache import getline
  
  with open("file_text.txt") as f:
      for ind, line in enumerate(f,1):
          if line.rstrip() == "---|---":
              print(getline(f.name, ind + 4))
  </code></pre>
  
  <p>Basically the <code>line.rstrip == '---|---'</code> is the point in which, when I run the program, that line is where the comments from the actual page itself is showed, and not the comments from the source.</p>