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: `logger.warn` method is used in "Logging HOWTO" documentation though `logger.warn` method is deprecated in Python 3.7
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Yuuji KAWAMATSU, docs@python, vinay.sajip, xtreak, yuji38kwmt
Priority: normal Keywords: patch, patch, patch

Created on 2019-01-19 04:50 by yuji38kwmt, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11654 merged Yuuji KAWAMATSU, 2019-01-23 01:41
PR 11657 merged miss-islington, 2019-01-23 07:27
Messages (5)
msg334030 - (view) Author: yuji38kwmt (yuji38kwmt) Date: 2019-01-19 04:50
### 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
msg334031 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-01-19 05:05
Thanks for the report. Would you like to propose a PR for this? 

Cases of using warn method in documentation examples : 

* https://github.com/python/cpython/blob/master/Doc/howto/logging.rst
* https://github.com/python/cpython/blob/master/Doc/howto/logging-cookbook.rst

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')
msg334119 - (view) Author: Yuuji KAWAMATSU (Yuuji KAWAMATSU) * Date: 2019-01-21 10:15
Thank you!
I will create PR.
msg334252 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2019-01-23 07:27
New changeset cda73a5af2ff064ca82140342b3158851d43868f by Vinay Sajip (yuji38kwmt) in branch 'master':
bpo-35781: Changed references to deprecated 'warn' method in logging documentation in favour of 'warning' (GH-11654)
https://github.com/python/cpython/commit/cda73a5af2ff064ca82140342b3158851d43868f
msg334253 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2019-01-23 07:43
New changeset 3be19c082b7f0ba3cf6c28922d3577126871788e 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)
https://github.com/python/cpython/commit/3be19c082b7f0ba3cf6c28922d3577126871788e
History
Date User Action Args
2022-04-11 14:59:10adminsetgithub: 79962
2019-01-23 07:44:17vinay.sajipsetkeywords: patch, patch, patch
status: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-01-23 07:43:41vinay.sajipsetmessages: + msg334253
2019-01-23 07:29:24vinay.sajipsetpull_requests: - pull_request11452
2019-01-23 07:27:45vinay.sajipsetpull_requests: - pull_request11453
2019-01-23 07:27:38miss-islingtonsetpull_requests: + pull_request11452
2019-01-23 07:27:29miss-islingtonsetpull_requests: + pull_request11453
2019-01-23 07:27:27miss-islingtonsetpull_requests: + pull_request11451
2019-01-23 07:27:17vinay.sajipsetmessages: + msg334252
2019-01-23 07:17:39vinay.sajipsetpull_requests: - pull_request11443
2019-01-23 07:17:20vinay.sajipsetpull_requests: - pull_request11444
2019-01-23 01:41:41Yuuji KAWAMATSUsetkeywords: + patch
stage: patch review
pull_requests: + pull_request11444
2019-01-23 01:41:30Yuuji KAWAMATSUsetkeywords: + patch
stage: (no value)
pull_requests: + pull_request11443
2019-01-23 01:41:19Yuuji KAWAMATSUsetkeywords: + patch
stage: (no value)
pull_requests: + pull_request11442
2019-01-21 10:15:44Yuuji KAWAMATSUsetnosy: + Yuuji KAWAMATSU
messages: + msg334119
2019-01-19 05:05:04xtreaksetnosy: + vinay.sajip, xtreak

messages: + msg334031
versions: + Python 3.8
2019-01-19 04:50:52yuji38kwmtcreate