This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gregory.p.smith
Recipients gregory.p.smith, serhiy.storchaka
Date 2020-11-16.09:54:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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 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:11gregory.p.smithsetrecipients: + gregory.p.smith, serhiy.storchaka
2020-11-16 09:54:11gregory.p.smithsetmessageid: <>
2020-11-16 09:54:11gregory.p.smithlinkissue42367 messages
2020-11-16 09:54:11gregory.p.smithcreate