I\'m trying to set a umask using the os module. Please note my normal umask set in my ~/.profile is umask 0027.
In a bash shell,
umask 0022
>
Even though this would seem to be a straight system call, in this case it does seems to matter what Python version you are using:
It appears that os.open handles the pre-existing umask differently in Python 2.x and Python 3.x, possibly because 2.x is closer to the OS and 3.x does a bit more abstraction.
https://docs.python.org/2/library/os.html "The default mode is 0777 (octal), and the current umask value is first masked out."
There is no similar statement in https://docs.python.org/3/library/os.html