Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#15217 closed (fixed)

Cache setting deprecation warning is too aggressive

Reported by: adamv Owned by: nobody
Component: Core (Cache system) Version: master
Severity: Keywords: blocker
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

http://code.djangoproject.com/browser/django/trunk/django/core/cache/__init__.py#L77

I have Django project with no CACHES or CACHE_FOO settings in my settings.py. So I'm relying entirely on whatever is in the global_settings.py for these values (and CACHES={} here.)

The line 77 above says that if CACHES is not true, print a deprecation warning.

Thus, since I'm not setting anything up here, and CACHES is false in global_settings.py, I see this deprecation warning any time I run my app-specific unit tests.

The "default settings" should cause no pending deprecation error to be printed when the project itself isn't setting up any cache settings.

Change History (5)

comment:1 Changed 4 years ago by russellm

  • Keywords blocker added
  • milestone set to 1.3
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Agreed that we shouldn't be raising an warning if the user hasn't done something that requires attention. This is a problem with a new feature, so it's a blocker.

comment:2 Changed 4 years ago by adamv

For completeness, I run my app tests like "python -Wall manage.py <appname>"; I believe the -Wall is what makes this warning visible.

comment:3 Changed 4 years ago by russellm

@adamv - Sure; but that's only because it's a PendingDeprecationWarning. Come Django 1.4, it will be a full warning, and a whole lot more annoying.

comment:4 Changed 4 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

In [15406]:

Fixed #15217 -- Made the CACHE_BACKEND deprecation warning more selective, so it doesn't catch the default case. Thanks to adamv for the report.

comment:5 Changed 3 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top