This mail never gets delivered. Any ideas why?

Cameron Simpson cs at zip.com.au
Sun May 26 20:28:09 EDT 2013


On 27May2013 10:22, I wrote:
| | =>  903                         self.stdin.write(input)
[...]
| | self = <subprocess.Popen object>, self.stdin = <_io.BufferedWriter name=5>, self.stdin.write = <built-in method write of _io.BufferedWriter object>, input = 'kdsjfksdjkfjksdjfs\r\n\t'
| | TypeError: 'str' does not support the buffer interface 
| |       args = ("'str' does not support the buffer interface",) 
| |       with_traceback = <built-in method with_traceback of TypeError object>
| 
| This is symptomatic of sys.stdin (well, whatever you're writing to)
| being open in binary mode instead of text mode. And you're passing
| a str. Try passing std.encode().

Sorry, that should be "input.encode()".
-- 
Cameron Simpson <cs at zip.com.au>

PCs are like a submarine, it will work fine till you open Windows. - zollie101



More information about the Python-list mailing list