Here's an example where the absence of b
would throw a TypeError
exception in Python 3.x
>>> f=open("new", "wb")
>>> f.write("Hello Python!")
Traceback (most recent call last):
File "", line 1, in
TypeError: 'str' does not support the buffer interface
Adding a b
prefix would fix the problem.