'wb' is supported, but in Python 3.x, the issue is that the content read is binary mode, so the string should be encode to be rewritten, otherwise there will be an exception 
`TypeError: 'str' does not support the buffer interface`

avoid use binary format fix this issue in Python 3.x