ソースを参照

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

Ask Solem 10 年 前
コミット
99cc3e454b
1 ファイル変更2 行追加1 行削除
  1. 2 1
      celery/platforms.py

+ 2 - 1
celery/platforms.py

@@ -295,7 +295,8 @@ class DaemonContext(object):
     def __init__(self, pidfile=None, workdir=None, umask=None,
                  fake=False, after_chdir=None, **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