Opened 62 minutes ago
Last modified 62 minutes ago
#37352 new Bug
ServerFormatter changed incompatibly in Django 2.1
| Reported by: | Jacob Walls | Owned by: | |
|---|---|---|---|
| Component: | Utilities | Version: | 2.1 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
While developing djangoproject.com, a failing request spewed a large stacktrace to my terminal, as described here. Root cause was: that project's logging config extends Django's, and it never caught up with a backward incompatible change in Django 2.1 (#28810) that meant the injection of the server_time variable would only happen for f-string format strings, no longer for %-style format strings.
This breaking change was mentioned during triage but didn't get a response during review.
Of course, I could fix this in djangoproject.com, but it's just as easy to fix it in Django where other projects could benefit.
Proposal: this util:
def uses_server_time(self): return self._fmt.find("{server_time}") >= 0
Should not assume f-string style formatting.