Message166985
| 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 |
<1343726625.19.0.329565614025.issue13498@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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: http://hg.python.org/cpython/file/3a08d766eee3/Lib/os.py#l270
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."
Opinions? |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年07月31日 09:23:45 | hynek | set | recipients:
+ 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:45 | hynek | set | messageid: <1343726625.19.0.329565614025.issue13498@psf.upfronthosting.co.za> |
| 2012年07月31日 09:23:44 | hynek | link | issue13498 messages |
| 2012年07月31日 09:23:44 | hynek | create |
|