#25597: Python 3 compatibility error in PostgreSQL array form fields
----------------------------------+--------------------
     Reporter:  BertrandBordage   |      Owner:
         Type:  Bug               |     Status:  new
    Component:  contrib.postgres  |    Version:  master
     Severity:  Normal            |   Keywords:
 Triage Stage:  Unreviewed        |  Has patch:  0
Easy pickings:  1                 |      UI/UX:  0
----------------------------------+--------------------
 
[https://github.com/django/django/blob/master/django/contrib/postgres/forms/array.py
 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:

 {{{#!python
 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'`

--
Ticket URL: <https://code.djangoproject.com/ticket/25597>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/058.0ffc1fbdebce2d96f2b84a1c0e55cbfe%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to