Index: subprocess.py =================================================================== --- subprocess.py (revision 64516) +++ subprocess.py (working copy) @@ -656,7 +656,9 @@ stdout = None stderr = None if self.stdin: - if input: + if input is not None: + if isinstance(input, str): + input = input.encode() self.stdin.write(input) self.stdin.close() elif self.stdout: