Index: utils/lit/lit/util.py =================================================================== --- utils/lit/lit/util.py +++ utils/lit/lit/util.py @@ -10,6 +10,8 @@ def to_bytes(str): # Encode to UTF-8 to get binary data. + if isinstance(str, bytes): + return str return str.encode('utf-8') def to_string(bytes): @@ -200,6 +202,8 @@ If the timeout is hit an ``ExecuteCommandTimeoutException`` is raised. """ + if input is not None: + input = to_bytes(input) p = subprocess.Popen(command, cwd=cwd, stdin=subprocess.PIPE, stdout=subprocess.PIPE,