mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Fix invalid auto_int value error when --umask=0 passed (#1632)
Fixes #1622
This commit is contained in:
parent
a3e258f24a
commit
90b7daebb6
@ -43,8 +43,8 @@ def make_settings(ignore=None):
|
||||
|
||||
|
||||
def auto_int(_, x):
|
||||
if x.startswith('0') and not x.lower().startswith('0x'):
|
||||
# for compatible with octal numbers in python3
|
||||
# for compatible with octal numbers in python3
|
||||
if re.match(r'0(\d)', x, re.IGNORECASE):
|
||||
x = x.replace('0', '0o', 1)
|
||||
return int(x, 0)
|
||||
|
||||
|
||||
@ -374,7 +374,9 @@ def test_reload(options, expected):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("options, expected", [
|
||||
(["--umask 0", "myapp:app"], 0),
|
||||
(["--umask", "0", "myapp:app"], 0),
|
||||
(["--umask", "0o0", "myapp:app"], 0),
|
||||
(["--umask", "0x0", "myapp:app"], 0),
|
||||
(["--umask", "0xFF", "myapp:app"], 255),
|
||||
(["--umask", "0022", "myapp:app"], 18),
|
||||
])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user