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 hynek
Recipients Arfrever, Axel.Wegen, Laurent.Mazuel, belopolsky, d0ugal, docs@python, draghuram, eric.araujo, georg.brandl, ggenellina, giampaolo.rodola, hynek, ijmorlan, jokoala, r.david.murray, terry.reedy, ysj.ray, zooko
Date 2012-07-31.09:23:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
So, IMHO if someone calls os.makedirs with a mode != 0o777, they expect to have the directories having those modes afterward. So raising no error if they exist and have the wrong mode would be a plain bug.

Python 3.3 already has a helpful error message:

FileExistsError: [Errno 17] File exists (mode 777 != expected mode 755): 'foo'

and it also handles the sticky issue gracefully: 

So this are an non-issues for 3.3. I'm not sure if it's severe enough to be back ported to 3.2.

So there’s only one thing left: the docs are wrong and should be fixed about exist_ok's behavior for both 3.2 & 3.3.

That said, I see the rationale for fixing the permissions but we can't just change os.makedirs at this point.

So I'd propose to add a "fix_permissions" bool flag that would allow the "no matter what the state is now, I want dir x with permissions y, do whatever is necessary workflow."

Date User Action Args
2012-07-31 09:23:45hyneksetrecipients: + hynek, georg.brandl, terry.reedy, zooko, belopolsky, ggenellina, draghuram, giampaolo.rodola, ijmorlan, eric.araujo, Arfrever, r.david.murray, ysj.ray, docs@python, Laurent.Mazuel, jokoala, Axel.Wegen, d0ugal
2012-07-31 09:23:45hyneksetmessageid: <>
2012-07-31 09:23:44hyneklinkissue13498 messages
2012-07-31 09:23:44hynekcreate