Python - Comment puis-je passer une chaîne en sous-processus.Popen (à l'aide de la stdin argument)?

Si je ne les suivants:

import subprocess
from cStringIO import StringIO
subprocess.Popen(['grep','f'],stdout=subprocess.PIPE,stdin=StringIO('one\ntwo\nthree\nfour\nfive\nsix\n')).communicate()[0]

J'obtiens:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/build/toolchain/mac32/python-2.4.3/lib/python2.4/subprocess.py", line 533, in __init__
    (p2cread, p2cwrite,
  File "/build/toolchain/mac32/python-2.4.3/lib/python2.4/subprocess.py", line 830, in _get_handles
    p2cread = stdin.fileno()
AttributeError: 'cStringIO.StringI' object has no attribute 'fileno'

Apparemment un cStringIO.StringIO objet n'a pas de couac assez près pour un fichier de canard à la fonction de sous-processus.Popen. Comment puis-je contourner cela?