[Django] #23489: Test failures with numpy 1.9

8 views
Skip to first unread message

Django

unread,
Sep 15, 2014, 1:54:06 PM9/15/14
to django-...@googlegroups.com
#23489: Test failures with numpy 1.9
-------------------------------------------+------------------------
Reporter: timgraham | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
Installing numpy 1.9 and `./runtests template_tests` will give some test
failures like this:
{{{
Template test (Cached='True', TEMPLATE_STRING_IF_INVALID='',
TEMPLATE_DEBUG=True): numpy-array-index02 -- FAILED. Got <type
'exceptions.IndexError'>, exception: index 5 is out of bounds for axis 0
with size 2
Traceback (most recent call last):

File "/home/tim/code/django/tests/template_tests/tests.py", line 596, in
test_templates
output = self.render(test_template, vals)

File "/home/tim/code/django/tests/template_tests/tests.py", line 622, in
render
output = test_template.render(context)

File "/home/tim/code/django/django/template/base.py", line 150, in
render
return self._render(context)

File "/home/tim/code/django/django/test/utils.py", line 89, in
instrumented_test_render
return self.nodelist.render(context)

File "/home/tim/code/django/django/template/base.py", line 853, in
render
bit = self.render_node(node, context)

File "/home/tim/code/django/django/template/debug.py", line 80, in
render_node
return node.render(context)

File "/home/tim/code/django/django/template/debug.py", line 90, in
render
output = self.filter_expression.resolve(context)

File "/home/tim/code/django/django/template/base.py", line 598, in
resolve
obj = self.var.resolve(context)

File "/home/tim/code/django/django/template/base.py", line 739, in
resolve
value = self._resolve_lookup(context)

File "/home/tim/code/django/django/template/base.py", line 769, in
_resolve_lookup
current = current[bit]

IndexError: index 5 is out of bounds for axis 0 with size 2
}}}

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

Django

unread,
Sep 28, 2014, 7:33:29 PM9/28/14
to django-...@googlegroups.com
#23489: Test failures with numpy 1.9
---------------------------------+------------------------------------

Reporter: timgraham | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by timgraham):

* has_patch: 0 => 1


Comment:

Here is the change in behavior:

NumPy < 1.9
{{{
>>> numpy.array(["first item", "second item"])['2']


Traceback (most recent call last):

File "<stdin>", line 1, in <module>
ValueError: field named 2 not found
}}}

NumPy 1.9+
{{{
>>> numpy.array(["first item", "second item"])['2']


Traceback (most recent call last):

File "<stdin>", line 1, in <module>
IndexError: index 2 is out of bounds for axis 0 with size 2
}}}

Attaching a patch to fix it. I guess we shouldn't backport, but require
specific version of test dependencies in Jenkins as suggested in #21793.

The original issue where these tests were added: [7d5e35cd].

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

Django

unread,
Sep 29, 2014, 7:32:38 PM9/29/14
to django-...@googlegroups.com
#23489: Test failures with numpy 1.9
---------------------------------+------------------------------------

Reporter: timgraham | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------

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

In [changeset:"4743a944295faccb494e31b7a805499bad2cedaa"]:
{{{
#!CommitTicketReference repository=""
revision="4743a944295faccb494e31b7a805499bad2cedaa"
[1.7.x] Required numpy < 1.9 for tests; refs #23489.
}}}

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

Django

unread,
Sep 29, 2014, 7:58:43 PM9/29/14
to django-...@googlegroups.com
#23489: Test failures with numpy 1.9
---------------------------------+------------------------------------

Reporter: timgraham | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------

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

In [changeset:"011541d948dac99100940e974f5cf243199be534"]:
{{{
#!CommitTicketReference repository=""
revision="011541d948dac99100940e974f5cf243199be534"
[1.6.x] Required numpy < 1.9 for tests; refs #23489.

Backport of 4743a94429 from stable/1.7.x
}}}

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

Django

unread,
Sep 29, 2014, 8:23:52 PM9/29/14
to django-...@googlegroups.com
#23489: Test failures with numpy 1.9
---------------------------------+------------------------------------

Reporter: timgraham | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------

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

In [changeset:"df657a768248c07fdbdc950b08366f655d0f2f5d"]:
{{{
#!CommitTicketReference repository=""
revision="df657a768248c07fdbdc950b08366f655d0f2f5d"
[1.4.x] Required numpy < 1.9 for tests; refs #23489.

Backport of 4743a94429 from stable/1.7.x
}}}

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

Django

unread,
Sep 29, 2014, 8:40:58 PM9/29/14
to django-...@googlegroups.com
#23489: Test failures with numpy 1.9
---------------------------------+------------------------------------
Reporter: timgraham | Owner: nobody
Type: Bug | Status: closed

Component: Template system | Version: 1.7
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"12809e160995eb617fe394c75e5b9f3211c056ff"]:
{{{
#!CommitTicketReference repository=""
revision="12809e160995eb617fe394c75e5b9f3211c056ff"
Fixed #23489 -- Added numpy 1.9+ support in template lookups
}}}

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

Reply all
Reply to author
Forward
0 new messages