title: Python subprocess "object has no attribute 'fileno'" error
body: <p>This code generates "AttributeError: 'Popen' object has no attribute 'fileno'" when run with Python 2.5.1 </p>
  
  <p>Code:</p>
  
  <pre><code>def get_blame(filename): 
      proc = []
      proc.append(Popen(['svn', 'blame', shellquote(filename)], stdout=PIPE))
      proc.append(Popen(['tr', '-s', r"'\040'"], stdin=proc[-1]), stdout=PIPE)
      proc.append(Popen(['tr', r"'\040'", r"';'"], stdin=proc[-1]), stdout=PIPE)
      proc.append(Popen(['cut', r"-d", r"\;", '-f', '3'], stdin=proc[-1]), stdout=PIPE)
      return proc[-1].stdout.read()
  </code></pre>
  
  <p>Stack:</p>
  
  <pre><code>function walk_folder in blame.py at line 55
  print_file(os.path.join(os.getcwd(), filename), path)
  
  function print_file in blame.py at line 34
  users = get_blame(filename)
  
  function get_blame in blame.py at line 20
  proc.append(Popen(['tr', '-s', r"'\040'"], stdin=proc[-1]), stdout=PIPE)
  
  function __init__ in subprocess.py at line 533
  (p2cread, p2cwrite,
  
  function _get_handles in subprocess.py at line 830
  p2cread = stdin.fileno()
  </code></pre>
  
  <p>This code should be working the python docs describe <a href="http://docs.python.org/library/subprocess.html#subprocess-replacements" rel="noreferrer">this usage</a>.</p>