This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Typo in logging.Formatter docstring
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: MarSoft, terry.reedy, vinay.sajip
Priority: normal Keywords: patch, patch

Created on 2018-08-16 19:52 by MarSoft, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8811 merged vinay.sajip, 2018-08-18 19:09
PR 8811 merged vinay.sajip, 2018-08-18 19:09
PR 8816 merged miss-islington, 2018-08-19 04:15
PR 8817 merged miss-islington, 2018-08-19 04:15
Messages (6)
msg323618 - (view) Author: Semyon (MarSoft) Date: 2018-08-16 19:52
There is a typo in the docstring for logging.Formatter:

> default value of "%s(message)\\n" is used.

I am sure it should be different (and in sync with the actual value):

> default value of "%(message)s\\n" is used.

The problem is in py2.7, py3.7 and most likely other versions.
msg323685 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-08-17 22:47
The default format depends on the style.  From 3.8:

class Formatter()
   <docstring>
    def __init__(self, fmt=None, datefmt=None, style='%'):
        ...
        self._fmt = self._style._fmt

It appears that the class docstring was not updated when the style parameter was added, in 3.2.  So I think more change is needed.  I will try to make a proposal later.
msg323694 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-08-18 08:13
... the style-dependent default value, "%(message)s", "{message}", or "${message}", is used.
msg323741 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2018-08-19 04:14
New changeset d3d3171da895d8cb880f23fae6be778f0ac23be7 by Vinay Sajip in branch 'master':
bpo-34415: Updated logging.Formatter docstring. (GH-8811)
https://github.com/python/cpython/commit/d3d3171da895d8cb880f23fae6be778f0ac23be7
msg323746 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2018-08-19 07:19
New changeset fed871835ee54f50cabcec6239271739ed4839f5 by Vinay Sajip (Miss Islington (bot)) in branch '3.6':
bpo-34415: Updated logging.Formatter docstring. (GH-8811) (GH-8816)
https://github.com/python/cpython/commit/fed871835ee54f50cabcec6239271739ed4839f5
msg323747 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2018-08-19 07:20
New changeset 2e4ae8f1b3147d7f0a461b4ffdde9bcc9e6a2083 by Vinay Sajip (Miss Islington (bot)) in branch '3.7':
bpo-34415: Updated logging.Formatter docstring. (GH-8811) (GH-8817)
https://github.com/python/cpython/commit/2e4ae8f1b3147d7f0a461b4ffdde9bcc9e6a2083
History
Date User Action Args
2022-04-11 14:59:04adminsetgithub: 78596
2018-08-19 07:27:41vinay.sajipsetkeywords: patch, patch
status: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: - Python 2.7
2018-08-19 07:20:16vinay.sajipsetmessages: + msg323747
2018-08-19 07:19:35vinay.sajipsetmessages: + msg323746
2018-08-19 04:15:34miss-islingtonsetpull_requests: + pull_request8295
2018-08-19 04:15:27miss-islingtonsetpull_requests: + pull_request8294
2018-08-19 04:14:24vinay.sajipsetmessages: + msg323741
2018-08-18 19:09:54vinay.sajipsetkeywords: + patch
stage: patch review
pull_requests: + pull_request8289
2018-08-18 19:09:52vinay.sajipsetkeywords: + patch
stage: (no value)
pull_requests: + pull_request8288
2018-08-18 08:13:23terry.reedysetmessages: + msg323694
2018-08-17 22:47:16terry.reedysetnosy: + vinay.sajip, terry.reedy
messages: + msg323685
2018-08-17 22:36:31terry.reedysetversions: + Python 3.8, - Python 3.4, Python 3.5
2018-08-16 19:52:26MarSoftcreate