You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation says that Gunicorn should accept "a string compatible with int(value, 0)". I don't know about in a config file, but when specifying via the command line (--umask,-m), only integers are supported. Hex strings are rejected...
I don't find any int(..., 0) call in codebase. In any case, we should update documentation and examples/example_config.py. Also, os.umask() does the following:
@benoitc well.. I didn't actually want to use hexadecimal, it was just the easiest example to show Gunicorn not working as documented.
Octal, on the other hand, is much friendlier than decimal for setting a umask and I spent quite a while trying to figure out why my permissions were all wrong before I realised the octal number I'd passed to Gunicorn (0117) was being interpreted as decimal (117) instead of what the documentation suggests (int('0117', 0) -> 79).
Activity
benoitc commentedon Aug 8, 2016
It's not expected to give the umask as hexadecimal? Why do you need it?
berkerpeksag commentedon Aug 8, 2016
I don't find any
int(..., 0)call in codebase. In any case, we should update documentation andexamples/example_config.py. Also,os.umask()does the following:JayH5 commentedon Aug 8, 2016
@benoitc well.. I didn't actually want to use hexadecimal, it was just the easiest example to show Gunicorn not working as documented.
Octal, on the other hand, is much friendlier than decimal for setting a umask and I spent quite a while trying to figure out why my permissions were all wrong before I realised the octal number I'd passed to Gunicorn (
0117) was being interpreted as decimal (117) instead of what the documentation suggests (int('0117', 0)->79).JayH5 commentedon Aug 8, 2016
@berkerpeksag there's an
int(..., 0)call when the argument is validated as a number: https://github.com/benoitc/gunicorn/blob/19.6.0/gunicorn/config.py#L320That just doesn't seem to apply at the right stage in the processing of arguments... or something.. I'm not sure.
benoitc commentedon Aug 8, 2016
ok so the real issue is the validation:
https://github.com/benoitc/gunicorn/blob/19.6.0/gunicorn/config.py#L975
we need to make sure we can handle the octal version.
hramezani commentedon Feb 19, 2017
#1465