浏览代码

Preserve old umask parsing behavior so that --umask starting with 0 is octal, otherwise decimal

Ask Solem 10 年之前
父节点
当前提交
953c9141f6
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      celery/platforms.py

+ 2 - 1
celery/platforms.py

@@ -296,7 +296,8 @@ class DaemonContext(object):
                  fake=False, after_chdir=None, after_forkers=True,
                  **kwargs):
         if isinstance(umask, string_t):
-            umask = int(umask, 8)  # convert str -> octal
+            # octal or decimal, depending on initial zero.
+            umask = int(umask, 8 if umask.startswith('0') else 10)
         self.workdir = workdir or DAEMON_WORKDIR
         self.umask = umask
         self.fake = fake