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

logger.warn method is used in "Logging HOWTO" documentation though logger.warn method is deprecated in Python 3.7 #79962

Closed
yuji38kwmt mannequin opened this issue Jan 19, 2019 · 5 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@yuji38kwmt
Copy link
Mannequin

yuji38kwmt mannequin commented Jan 19, 2019

BPO 35781
Nosy @vsajip, @tirkarthi, @yuji38kwmt
PRs
  • bpo-35781: Changed references to deprecated 'warn' method in logging documentation in favour of 'warning' #11654
  • [3.7] bpo-35781: Changed references to deprecated 'warn' method in logging documentation in favour of 'warning' (GH-11654) #11657
  • 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 2019-01-23.07:44:17.139>
    created_at = <Date 2019-01-19.04:50:52.260>
    labels = ['3.8', 'type-bug', '3.7', 'docs']
    title = '`logger.warn` method is used in "Logging HOWTO" documentation though `logger.warn` method is deprecated in Python 3.7'
    updated_at = <Date 2019-01-23.07:44:17.138>
    user = 'https://bugs.python.org/yuji38kwmt'

    bugs.python.org fields:

    activity = <Date 2019-01-23.07:44:17.138>
    actor = 'vinay.sajip'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2019-01-23.07:44:17.139>
    closer = 'vinay.sajip'
    components = ['Documentation']
    creation = <Date 2019-01-19.04:50:52.260>
    creator = 'yuji38kwmt'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35781
    keywords = ['patch', 'patch', 'patch']
    message_count = 5.0
    messages = ['334030', '334031', '334119', '334252', '334253']
    nosy_count = 5.0
    nosy_names = ['vinay.sajip', 'docs@python', 'xtreak', 'yuji38kwmt', 'Yuuji KAWAMATSU']
    pr_nums = ['11654', '11657']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue35781'
    versions = ['Python 3.7', 'Python 3.8']

    @yuji38kwmt
    Copy link
    Mannequin Author

    yuji38kwmt mannequin commented Jan 19, 2019

    ### Target Documentation

    https://docs.python.org/3/howto/logging.html#configuring-logging

    ### Actual Sample Code

    # 'application' code
    logger.debug('debug message')
    logger.info('info message')
    logger.warn('warn message')
    logger.error('error message')
    logger.critical('critical message')
    

    ### Expected Sample Code

    # 'application' code
    logger.debug('debug message')
    logger.info('info message')
    logger.warning('warn message')
    logger.error('error message')
    logger.critical('critical message')
    

    ### Reference

    There is an obsolete method warn which is functionally identical to warning. As warn is deprecated, please do not use it - use warning instead.

    https://docs.python.org/3.7/library/logging.html#logging.Logger.warning

    @yuji38kwmt yuji38kwmt mannequin added the 3.7 (EOL) end of life label Jan 19, 2019
    @yuji38kwmt yuji38kwmt mannequin assigned docspython Jan 19, 2019
    @yuji38kwmt yuji38kwmt mannequin added docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error labels Jan 19, 2019
    @tirkarthi
    Copy link
    Member

    Thanks for the report. Would you like to propose a PR for this?

    Cases of using warn method in documentation examples :

    Doc/howto/logging.rst
    613: logger.warn('warn message')
    643: logger.warn('warn message')

    Doc/howto/logging-cookbook.rst
    189: logger.warn('warn message')
    298: logger.warn('warn message')

    @tirkarthi tirkarthi added the 3.8 only security fixes label Jan 19, 2019
    @yuji38kwmt
    Copy link
    Mannequin Author

    yuji38kwmt mannequin commented Jan 21, 2019

    Thank you!
    I will create PR.

    @vsajip
    Copy link
    Member

    vsajip commented Jan 23, 2019

    New changeset cda73a5 by Vinay Sajip (yuji38kwmt) in branch 'master':
    bpo-35781: Changed references to deprecated 'warn' method in logging documentation in favour of 'warning' (GH-11654)
    cda73a5

    @vsajip
    Copy link
    Member

    vsajip commented Jan 23, 2019

    New changeset 3be19c0 by Vinay Sajip (Miss Islington (bot)) in branch '3.7':
    bpo-35781: Changed references to deprecated 'warn' method in logging documentation in favour of 'warning' (GH-11654) (GH-11657)
    3be19c0

    @vsajip vsajip closed this as completed Jan 23, 2019
    @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 docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants