That is from the *nix manpage, so it is safe to assume that an exception will never be raised by Python on a *nix system. The question is rather how the Python implementation handles os.umask on a an unsupported system.

It is possible to handle that case if it turns out to be a problem later on. Thanks for looking into it.