From b4d0bd5a894e9861297e8ccd1527e9c3c6c5e86f Mon Sep 17 00:00:00 2001 From: "Paul J. Dorn" Date: Sat, 17 Aug 2024 01:51:40 +0200 Subject: [PATCH] python 3: leading zero still octal --- docs/source/settings.rst | 4 +++- gunicorn/config.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/source/settings.rst b/docs/source/settings.rst index bcc403af5..07d558041 100644 --- a/docs/source/settings.rst +++ b/docs/source/settings.rst @@ -1151,9 +1151,11 @@ Note that this affects unix socket permissions. A valid value for the ``os.umask(mode)`` call or a string compatible with ``int(value, 0)`` (``0`` means Python guesses the base, so values -like ``0``, ``0xFF``, ``0022`` are valid for decimal, hex, and octal +like ``0``, ``0xFF``, ``0o022`` are valid for decimal, hex, and octal representations) +.. note:: For historical reasons, leading zero is treated like ``0o``. + .. _initgroups: ``initgroups`` diff --git a/gunicorn/config.py b/gunicorn/config.py index db66f684f..a31dbd7bf 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -1197,8 +1197,10 @@ class Umask(Setting): A valid value for the ``os.umask(mode)`` call or a string compatible with ``int(value, 0)`` (``0`` means Python guesses the base, so values - like ``0``, ``0xFF``, ``0022`` are valid for decimal, hex, and octal + like ``0``, ``0xFF``, ``0o022`` are valid for decimal, hex, and octal representations) + + .. note:: For historical reasons, leading zero is treated like ``0o``. """