Message381082
os.makedirs used to pass its mode argument on down recursively so that every level of directory it created would have the specified permissions.
That was removed in Python 3.7 as https://bugs.python.org/issue19930 as if it were a mis-feature. Maybe it was in one situation, but it was also a desirable *feature*. It wasn't a bug.
We've got 15 year old code depending on that and the only solution for it to work on Python 3.7-3.9 is to reimplement recursive directory creation. :(
This feature needs to be brought back. Rather than flip flop on the API, adding an flag to indicate if the permissions should be applied recursively or not seems like the best way forward.
The "workaround" documented in the above bug is invalid. umask cannot be used to control the intermediate directory creation permissions as that is a process wide global that would impact other threads or signal handlers. umask also cannot be used as umask does not allow setting of special bits such as stat.S_ISVTX.
result: Our old os.makedirs() code that tried to set the sticky bit (ISVTX) on all directories now fails to set it at all levels. |
|
Date |
User |
Action |
Args |
2020-11-16 09:54:11 | gregory.p.smith | set | recipients:
+ gregory.p.smith, serhiy.storchaka |
2020-11-16 09:54:11 | gregory.p.smith | set | messageid: <1605520451.51.0.153670810596.issue42367@roundup.psfhosted.org> |
2020-11-16 09:54:11 | gregory.p.smith | link | issue42367 messages |
2020-11-16 09:54:11 | gregory.p.smith | create | |
|