In Python 2, writing directly to a file handle returns None:
Python 2.x2.3
hi = sys.stdout.write('hello world\n')
# Out: hello world
type(hi)
# Out: <type 'NoneType'>
In Python 3, writing to a handle will return the number of characters written when writing text, and the number of by...