Python encoding for pipe.communicate
- by Brian M. Hunt
I'm calling pipe.communicate from Python's subprocess module from Python 2.6. I get the following error from this code:
from subprocess import Popen
pipe = Popen(cwd)
pipe.communicate( data )
For an arbitrary cwd, and where data that contains unicode (specifically 0xE9):
Exec. exception: 'ascii' codec can't encode character u'\xe9' in…