Python3 write fix