You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django developers (Contributions to Django itself)
During a review session I noticed the existence of `DjangoRuntimeWarning`[1] which was introduced in order to be subclassed to warn about about cache keys that are not compatible with Memcache[2].
As our test suite demonstrate subclassing `RuntimeWarning` can be quite useful when you want to consider some of them as errors[3] or simply ignore them. I'm sure some of you will remember the pesky naive datetime warnings that were raised when using the SQLite3 backend with IPython when timezone support was introduced.
While reviewing a proposed change where I suggested introducing another `DjangoRuntimeWarning` just like we do with the cache key warning Claude noted that we should always use such a patten or simply drop it[4] as a quick `grep RuntimeWarning django -r` revealed the cache key warning was the only occurence of `DjangoRuntimeWarning`.
While I don't think subclassing `DjangoRuntimeWarning` for every internal use of `warnings.warn` is required I believe using `DjangoRuntimeWarning` instead of `RuntimeWarning` would make sense.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django developers (Contributions to Django itself)
I think warnings.filterwarnings(RuntimeWarning, module="django..") might allow filtering without a subclass?
According to the ticket, Carl offered the version of the patch with DjangoRuntimeWarning "following design discussion with Russell K-M, Malcolm T, Jannis L, and Jeremy Dunck." (in case any of them are reading this and remember the discussion from 6 years ago) [0].