[issue29214] Standard open() does not allow to specify file permissions.

STINNER Victor report at bugs.python.org
Tue Jan 10 16:11:59 EST 2017


STINNER Victor added the comment:

I don't understand the problem with umask(). It's standard and affect all
code even C extension calling directly or indirectly open(). It is more
secure to use umask() than setting mode on a few Python open() calls no?

For example, Python creates .pyc files. You cannot (easily) modify the
open() call to set mode, whereas it is affected by umask().

If you call umask() at startup, it affects all threads, there is no race
condition like open()+fchmod().

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29214>
_______________________________________


More information about the Python-bugs-list mailing list