[issue5220] os.makedirs' mode argument has bad default value

2010-06-14 Thread Sindre Myren
Sindre Myren added the comment: Thank you very much for the clarification :) -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue5220] os.makedirs' mode argument has bad default value

2010-06-14 Thread Martin v . Löwis
Martin v. Löwis added the comment: > I (as a programmer) have never seen the specific code for python's > mkdir function, And I have no way to know whether I should presume > that mkdir in python works the same way as the gnu command or not. > Unless it is documented that is. You should assume

[issue5220] os.makedirs' mode argument has bad default value

2010-06-14 Thread Sindre Myren
Sindre Myren added the comment: *Sorry.. A bit quick there. The line >> os.mkdir('test4') should have been: >> os.mkdir('test4', 0777) -- ___ Python tracker ___

[issue5220] os.makedirs' mode argument has bad default value

2010-06-14 Thread Sindre Myren
Sindre Myren added the comment: >I don't understand what you mean when you say "how umask works in >relation to Python". How it works in relation to Python isn't different >from how it works for any other Unix program. Consider, for example, >the unix man page for 'open'. This is what I me

[issue5220] os.makedirs' mode argument has bad default value

2010-06-13 Thread R. David Murray
R. David Murray added the comment: I don't understand what you mean when you say "how umask works in relation to Python". How it works in relation to Python isn't different from how it works for any other Unix program. Consider, for example, the unix man page for 'open'. I don't think a do

[issue5220] os.makedirs' mode argument has bad default value

2010-06-13 Thread Sindre Myren
Sindre Myren added the comment: I have to agree with jab. While the way relative paths works are more or less common knowledge, the way umask does and does not work in relation to python isn't. It is however given a short description at http://docs.python.org/library/os.html#os.makedirs: ...

[issue5220] os.makedirs' mode argument has bad default value

2009-02-11 Thread Joshua Bronson
Joshua Bronson added the comment: > My suspicion is that people setting explicit file permissions > typically know what they are doing, and that you will find that > your tickets get closed as invalid, explaining to you that this > mode usage is fully intentional. For what it's worth, I asked M

[issue5220] os.makedirs' mode argument has bad default value

2009-02-11 Thread Martin v. Löwis
Martin v. Löwis added the comment: > My misunderstanding stemmed from recently coming across two widely-used > packages which both pass mode=0750 to os.makedirs. I have no idea why > they would be doing this (as it effectively throws away part of the > umask), unless they too are misunderstan

[issue5220] os.makedirs' mode argument has bad default value

2009-02-11 Thread Joshua Bronson
Joshua Bronson added the comment: Ah, I was misunderstanding the behavior of mkdir, thank you for the explanation. My misunderstanding stemmed from recently coming across two widely-used packages which both pass mode=0750 to os.makedirs. I have no idea why they would be doing this (as it eff

[issue5220] os.makedirs' mode argument has bad default value

2009-02-11 Thread Martin v. Löwis
Martin v. Löwis added the comment: I don't understand the problem. The directory creation *does* take the umask into account - that's the whole point of the umask! The directory being created has the bits (mode & ~umask & 0777) set - because of the semantics of mkdir(2), not because of Python's

[issue5220] os.makedirs' mode argument has bad default value

2009-02-11 Thread Joshua Bronson
New submission from Joshua Bronson : os.makedirs' mode argument defaults to a hardcoded value of 511 (0777 in octal). This forces the caller to either pass in a different hardcoded value (commonly 0750), or to implement a workaround that calculates the expected mode based on the process owner'