[Django] #23976: ValidationError by list argument

10 views
Skip to first unread message

Django

unread,
Dec 9, 2014, 7:40:30 AM12/9/14
to django-...@googlegroups.com
#23976: ValidationError by list argument
-------------------------------------+-------------------------------------
Reporter: archivarius888 | Owner: nobody
Type: Bug | Status: new
Component: Core | Version: master
(Serialization) | Keywords: exceptions,
Severity: Release blocker | ValidationError
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Redefinition variable message by django/django/core/exceptions.py
line 114, for message in message:

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

Django

unread,
Dec 9, 2014, 7:52:02 AM12/9/14
to django-...@googlegroups.com
#23976: ValidationError by list argument
-------------------------------------+-------------------------------------
Reporter: archivarius888 | Owner: nobody
Type: Bug | Status: new
Component: Core | Version: master
(Serialization) | Resolution:
Severity: Release blocker | Triage Stage:
Keywords: exceptions, | Unreviewed
ValidationError | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by archivarius888):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Old description:

> Redefinition variable message by django/django/core/exceptions.py
> line 114, for message in message:

New description:

Redefinition variable message by django/django/core/exceptions.py
line 114, for message in message:

below line, 116:

{{{
if not isinstance(message, ValidationError):
message = ValidationError(message)
self.error_list.extend(message.error_list)
}}}

if message isinstance of dict: AttributeError: 'ValidationError' object
has no attribute 'error_list'

--

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

Django

unread,
Dec 9, 2014, 8:07:20 AM12/9/14
to django-...@googlegroups.com
#23976: ValidationError by list argument
-------------------------------------+-------------------------------------
Reporter: archivarius888 | Owner: nobody
Type: Bug | Status: new
Component: Core | Version: master
(Serialization) | Resolution:
Severity: Release blocker | Triage Stage:
Keywords: exceptions, | Unreviewed
ValidationError | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by timgraham):

Could you provide the code to reproduce the error?

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

Django

unread,
Dec 9, 2014, 8:57:18 AM12/9/14
to django-...@googlegroups.com
#23976: ValidationError by list argument
-------------------------------------+-------------------------------------
Reporter: archivarius888 | Owner: nobody
Type: Bug | Status: new
Component: Core | Version: master
(Serialization) | Resolution:
Severity: Release blocker | Triage Stage:
Keywords: exceptions, | Unreviewed
ValidationError | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by archivarius888):

{{{
>>> from django.core.exceptions import ValidationError
>>> ValidationError([{}])

}}}

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

Django

unread,
Dec 9, 2014, 12:13:02 PM12/9/14
to django-...@googlegroups.com
#23976: ValidationError by list argument
-------------------------------------+-------------------------------------
Reporter: archivarius888 | Owner: nobody
Type: Bug | Status: new
Component: Core | Version: master
(Serialization) | Resolution:
Severity: Release blocker | Triage Stage:
Keywords: exceptions, | Unreviewed
ValidationError | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by whoshuu):

Under what circumstances does this exception get thrown? From the
definition of `message`, it doesn't appear that `[{}]` is a valid form of
`message`. If `message` does take that form somehow, then that's a
separate bug.

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

Django

unread,
Dec 9, 2014, 3:14:47 PM12/9/14
to django-...@googlegroups.com
#23976: ValidationError by list argument
-------------------------------------+-------------------------------------
Reporter: archivarius888 | Owner: nobody
Type: Bug | Status: new
Component: Core | Version: master
(Serialization) | Resolution:
Severity: Release blocker | Triage Stage:
Keywords: exceptions, | Unreviewed
ValidationError | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by archivarius888):

Yeap, I just code would be better. And the user can do anything.

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

Django

unread,
Dec 10, 2014, 8:28:29 AM12/10/14
to django-...@googlegroups.com
#23976: ValidationError crashes if initialized with a list of empty dicts

-------------------------------------+-------------------------------------
Reporter: archivarius888 | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Core (Other) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: exceptions, | Needs documentation: 0
ValidationError | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by timgraham):

* component: Core (Serialization) => Core (Other)
* stage: Unreviewed => Accepted
* type: Bug => Cleanup/optimization
* severity: Release blocker => Normal


Comment:

We could at least not crash so obscurely I suppose.

--
Ticket URL: <https://code.djangoproject.com/ticket/23976#comment:6>

Django

unread,
Jul 25, 2015, 11:40:06 AM7/25/15
to django-...@googlegroups.com
#23976: ValidationError crashes if initialized with a list of empty dicts
-------------------------------------+-------------------------------------
Reporter: archivarius888 | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: exceptions, | Triage Stage: Accepted
ValidationError |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

Comment (by takis):

Could not reproduce using current Django master on Python 3.4.1 on OSX
10.10.4.

--
Ticket URL: <https://code.djangoproject.com/ticket/23976#comment:7>

Django

unread,
Jul 12, 2018, 11:08:36 PM7/12/18
to django-...@googlegroups.com
#23976: ValidationError crashes if initialized with a list of empty dicts
-------------------------------------+-------------------------------------
Reporter: archivarius888 | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: exceptions, | Triage Stage: Accepted
ValidationError |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

Comment (by Adam Zapletal):

I've confirmed that the crash no longer happens on both `v2.0.7` and
`master` on Mac OS 10.13.5 with Python 3.7.0:

{{{
In [1]: import django

In [2]: django.__version__
Out[2]: '2.0.7'

In [3]: from django.core.exceptions import ValidationError

In [4]: ValidationError([{}])
Out[4]: ValidationError([])
}}}

{{{
In [1]: import django

In [2]: django.__version__
Out[2]: '2.2.dev20180711212029'

In [3]: from django.core.exceptions import ValidationError

In [4]: ValidationError([{}])
Out[4]: ValidationError([])
}}}

Can this ticket be closed?

--
Ticket URL: <https://code.djangoproject.com/ticket/23976#comment:8>

Django

unread,
Jul 13, 2018, 10:02:28 AM7/13/18
to django-...@googlegroups.com
#23976: ValidationError crashes if initialized with a list of empty dicts
-------------------------------------+-------------------------------------
Reporter: archivarius888 | Owner: nobody
Type: | Status: closed

Cleanup/optimization |
Component: Core (Other) | Version: master
Severity: Normal | Resolution: fixed

Keywords: exceptions, | Triage Stage: Accepted
ValidationError |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => fixed


--
Ticket URL: <https://code.djangoproject.com/ticket/23976#comment:9>

Reply all
Reply to author
Forward
0 new messages