[Django] #25597: Python 3 compatibility error in PostgreSQL array form fields

16 views
Skip to first unread message

Django

unread,
Oct 22, 2015, 3:40:42 PM10/22/15
to django-...@googlegroups.com
#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.

Django

unread,
Oct 22, 2015, 6:50:38 PM10/22/15
to django-...@googlegroups.com
#25597: Python 3 compatibility error in PostgreSQL array form fields
----------------------------------+------------------------------------

Reporter: BertrandBordage | Owner:
Type: Bug | Status: new
Component: contrib.postgres | Version: 1.8
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
----------------------------------+------------------------------------
Changes (by timgraham):

* severity: Normal => Release blocker
* needs_better_patch: => 0
* needs_tests: => 0
* version: master => 1.8
* needs_docs: => 0
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/25597#comment:1>

Django

unread,
Oct 26, 2015, 7:39:51 PM10/26/15
to django-...@googlegroups.com
#25597: Python 3 compatibility error in PostgreSQL array form fields
----------------------------------+------------------------------------

Reporter: BertrandBordage | Owner:
Type: Bug | Status: new
Component: contrib.postgres | Version: 1.8
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
----------------------------------+------------------------------------
Changes (by timgraham):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/5485 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/25597#comment:2>

Django

unread,
Oct 27, 2015, 8:13:26 AM10/27/15
to django-...@googlegroups.com
#25597: Python 3 compatibility error in PostgreSQL array form fields
-------------------------------------+-------------------------------------
Reporter: BertrandBordage | Owner: Tim
| Graham <timograham@…>
Type: Bug | Status: closed
Component: contrib.postgres | Version: 1.8
Severity: Release blocker | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* owner: => Tim Graham <timograham@…>
* resolution: => fixed


Comment:

In [changeset:"1f07da3e29c7c3d47968e1c4531dd9bf902575b7" 1f07da3e]:
{{{
#!CommitTicketReference repository=""
revision="1f07da3e29c7c3d47968e1c4531dd9bf902575b7"
Fixed #25597 -- Fixed crash with SplitArrayField and IntegerField on
invalid value.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25597#comment:3>

Django

unread,
Oct 27, 2015, 8:14:48 AM10/27/15
to django-...@googlegroups.com
#25597: Python 3 compatibility error in PostgreSQL array form fields
-------------------------------------+-------------------------------------
Reporter: BertrandBordage | Owner: Tim
| Graham <timograham@…>
Type: Bug | Status: closed
Component: contrib.postgres | Version: 1.8
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"64a9115bcecf48bce2e7a84d165a6628e2ce607c" 64a9115b]:
{{{
#!CommitTicketReference repository=""
revision="64a9115bcecf48bce2e7a84d165a6628e2ce607c"
[1.9.x] Fixed #25597 -- Fixed crash with SplitArrayField and IntegerField
on invalid value.

Backport of 1f07da3e29c7c3d47968e1c4531dd9bf902575b7 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25597#comment:5>

Django

unread,
Oct 27, 2015, 8:14:48 AM10/27/15
to django-...@googlegroups.com
#25597: Python 3 compatibility error in PostgreSQL array form fields
-------------------------------------+-------------------------------------
Reporter: BertrandBordage | Owner: Tim
| Graham <timograham@…>
Type: Bug | Status: closed
Component: contrib.postgres | Version: 1.8
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"69e6045ceb18d859a1586bcd5e64f9b786d87c32" 69e6045c]:
{{{
#!CommitTicketReference repository=""
revision="69e6045ceb18d859a1586bcd5e64f9b786d87c32"
[1.8.x] Fixed #25597 -- Fixed crash with SplitArrayField and IntegerField
on invalid value.

Backport of 1f07da3e29c7c3d47968e1c4531dd9bf902575b7 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25597#comment:4>

Reply all
Reply to author
Forward
0 new messages