#25597 closed Bug (fixed)
Python 3 compatibility error in PostgreSQL array form fields
Reported by: | Bertrand Bordage | Owned by: | |
---|---|---|---|
Component: | contrib.postgres | Version: | 1.8 |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
django.contrib.postgres.forms.array uses several times the old Exception.message
attribute to get the error message instead of str(Exception)
. This breaks compatibility with Python 3 at least when using SplitArrayField
, but it should also lead to errors on other form fields from this module.
Minimal example:
from django.contrib.postgres.forms import SplitArrayField from django.forms import IntegerField SplitArrayField(IntegerField(max_value=100), size=2).clean([0, 101])
This leads to an AttributeError: 'ValidationError' object has no attribute 'message'
Change History (5)
comment:1 by , 9 years ago
Severity: | Normal → Release blocker |
---|---|
Triage Stage: | Unreviewed → Accepted |
Version: | master → 1.8 |
comment:2 by , 9 years ago
Has patch: | set |
---|
Note:
See TracTickets
for help on using tickets.
PR