Opened 9 years ago

Last modified 8 years ago

#25999 closed Cleanup/optimization

Remove making deprecation warnings loud by default — at Version 3

Reported by: Tim Graham Owned by: Tim Graham
Component: Core (Other) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

See #18985 for the background of why we route warnings through logging.

However, this idea is slightly flawed given our current deprecation scheme. If a third-party library wants to support both 1.8 and 1.11 (next LTS) would have to use a try (new import)/except (old import) pattern to avoid code running on 1.11 from raising deprecation warnings (some pending deprecation in 1.10, deprecated in 1.11, and removed in 2.0). In my mind, part of the purpose of the new policy was to avoid this type of complexity.

For that reason, I think we should reconsider making Django's deprecation warnings loud by default (at least in LTS versions). Otherwise, users will pester library authors to fix those warnings and we haven't really made things easier.

Instead, the idea would be for library authors to continue using the deprecated APIs while supporting the LTS in which they are deprecated and the previous LTS. When the version of Django following the LTS is released, library authors can then drop support for all Django versions before the LTS, check their package with the LTS using python -Wd and make the deprecation warning fixes, then seamlessly add support for the next version of Django.

Change History (3)

comment:1 by Tim Graham, 9 years ago

I raised a proposal to discontinue making RemovedInNextVersionWarning loud by default.

comment:2 by Tim Graham, 9 years ago

Component: DocumentationCore (Other)
Owner: changed from nobody to Tim Graham
Status: newassigned
Summary: Document why Django makes its deprecation warnings loud by default and how to silence themRemove making deprecation warnings loud by default

comment:3 by Tim Graham, 9 years ago

Description: modified (diff)
Has patch: set
Note: See TracTickets for help on using tickets.
Back to Top