Skip to content

Typo in logging.Formatter docstring #78596

Closed

Description

@MarSoft
mannequin
BPO 34415
Nosy @terryjreedy, @vsajip, @MarSoft
PRs
  • bpo-34415: Updated logging.Formatter docstring regarding default format strings. #8811
  • bpo-34415: Updated logging.Formatter docstring regarding default format strings. #8811
  • [3.6] bpo-34415: Updated logging.Formatter docstring. (GH-8811) #8816
  • [3.7] bpo-34415: Updated logging.Formatter docstring. (GH-8811) #8817
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2018-08-19.07:27:41.125>
    created_at = <Date 2018-08-16.19:52:26.020>
    labels = ['3.8', '3.7', 'library']
    title = 'Typo in logging.Formatter docstring'
    updated_at = <Date 2018-08-19.07:27:41.053>
    user = 'https://github.com/MarSoft'

    bugs.python.org fields:

    activity = <Date 2018-08-19.07:27:41.053>
    actor = 'vinay.sajip'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-08-19.07:27:41.125>
    closer = 'vinay.sajip'
    components = ['Library (Lib)']
    creation = <Date 2018-08-16.19:52:26.020>
    creator = 'MarSoft'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34415
    keywords = ['patch', 'patch']
    message_count = 6.0
    messages = ['323618', '323685', '323694', '323741', '323746', '323747']
    nosy_count = 3.0
    nosy_names = ['terry.reedy', 'vinay.sajip', 'MarSoft']
    pr_nums = ['8811', '8811', '8816', '8817']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue34415'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8']

    Activity

    1. MarSoft commented on Aug 16, 2018

      MarSoftmannequin
      MannequinAuthor

      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.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Aug 16, 2018
    3. terryjreedy commented on Aug 17, 2018

      @terryjreedy
      Member

      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.

    4. terryjreedy commented on Aug 18, 2018

      @terryjreedy
      Member

      ... the style-dependent default value, "%(message)s", "{message}", or "${message}", is used.

    5. vsajip commented on Aug 19, 2018

      @vsajip
      Member

      New changeset d3d3171 by Vinay Sajip in branch 'master':
      bpo-34415: Updated logging.Formatter docstring. (GH-8811)
      d3d3171

    6. vsajip commented on Aug 19, 2018

      @vsajip
      Member

      New changeset fed8718 by Vinay Sajip (Miss Islington (bot)) in branch '3.6':
      bpo-34415: Updated logging.Formatter docstring. (GH-8811) (GH-8816)
      fed8718

    7. vsajip commented on Aug 19, 2018

      @vsajip
      Member

      New changeset 2e4ae8f by Vinay Sajip (Miss Islington (bot)) in branch '3.7':
      bpo-34415: Updated logging.Formatter docstring. (GH-8811) (GH-8817)
      2e4ae8f

    8. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)end of life3.8 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directory

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions