Author shai
Recipients shai
Date 2013-05-18.16:44:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1368895469.2.0.802658153503.issue18009@psf.upfronthosting.co.za>
In-reply-to
Content
At least on posix systems, os.write says it takes a string, but in fact it barfs on strings -- it needs bytes.

$ python
Python 3.3.1 (default, May  6 2013, 16:18:33) 
[GCC 4.7.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> print(os.write.__doc__)
write(fd, string) -> byteswritten

Write a string to a file descriptor.
>>> os.write(1, "hello")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'str' does not support the buffer interface
>>> os.write(1, b"hello")
hello5
>>>
History
Date User Action Args
2013-05-18 16:44:29shaisetrecipients: + shai
2013-05-18 16:44:29shaisetmessageid: <1368895469.2.0.802658153503.issue18009@psf.upfronthosting.co.za>
2013-05-18 16:44:29shailinkissue18009 messages
2013-05-18 16:44:29shaicreate