Patch # 1331 by Christian Heimes.
The patch fixes some of the problems on Windows. It doesn't introduce
addition problems on Linux.
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 6b9bb6b..6eb9385 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -809,6 +809,8 @@
 
             if self.stdin:
                 if input is not None:
+                    if isinstance(input, str):
+                        input = input.encode()
                     self.stdin.write(input)
                 self.stdin.close()