I was about to ask about respecting umask for the mode, but referring to the python docs I see the umask is used to mask out the mode we give here, so all is well :-)