fix for py 3.3

fix agains python 3.3 and 3.2 .

since 3.2 stdin can receive some BROKENPIPE input., ignore them. 

Also fix result from communicate to make sure we pass a string later.