Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo in logging.Formatter docstring #78596

Closed
MarSoft mannequin opened this issue Aug 16, 2018 · 6 comments
Closed

Typo in logging.Formatter docstring #78596

MarSoft mannequin opened this issue Aug 16, 2018 · 6 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir

Comments

@MarSoft
Copy link
Mannequin

MarSoft mannequin commented Aug 16, 2018

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']

    @MarSoft
    Copy link
    Mannequin Author

    MarSoft mannequin commented Aug 16, 2018

    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.

    @MarSoft MarSoft mannequin added 3.7 (EOL) end of life stdlib Python modules in the Lib dir labels Aug 16, 2018
    @terryjreedy terryjreedy added the 3.8 only security fixes label Aug 17, 2018
    @terryjreedy
    Copy link
    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.

    @terryjreedy
    Copy link
    Member

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

    @vsajip
    Copy link
    Member

    vsajip commented Aug 19, 2018

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

    @vsajip
    Copy link
    Member

    vsajip commented Aug 19, 2018

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

    @vsajip
    Copy link
    Member

    vsajip commented Aug 19, 2018

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

    @vsajip vsajip closed this as completed Aug 19, 2018
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants