[Django] #25108: Tests fails when using Pillow 2.9.0

2 views
Skip to first unread message

Django

unread,
Jul 11, 2015, 11:01:03 AM7/11/15
to django-...@googlegroups.com
#25108: Tests fails when using Pillow 2.9.0
-------------------------------+--------------------
Reporter: double-y | Owner: nobody
Type: Bug | Status: new
Component: HTTP handling | Version: master
Severity: Normal | Keywords: test
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
A test failed in python3.4.3

{{{
$ ./runtests.py ./forms_tests
Testing against Django installed in
'/Users/yasudayousuke/oss_hack/django_dev/django_parent/django'
Creating test database for alias 'default'...
Creating test database for alias 'other'...
..................................................................................................................F.....................................................................................................................................................................................................................................................................................................................s...........
======================================================================
FAIL: test_imagefield_annotate_with_bitmap_image_after_clean
(forms_tests.tests.test_fields.FieldsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/Users/yasudayousuke/oss_hack/django_dev/django_parent/tests/forms_tests/tests/test_fields.py",
line 862, in test_imagefield_annotate_with_bitmap_image_after_clean
self.assertIsNone(uploaded_file.content_type)
AssertionError: 'image/bmp' is not None
}}}

Probably the cause is the change of library Pillow added few days ago.
https://github.com/python-
pillow/Pillow/commit/fe18b039ca9e11c6deed8f21a9e5eca815badbb7

My Pillow version is 2.9.0, so the content_type is "image/bmp" and is not
None.

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

Django

unread,
Jul 11, 2015, 11:03:41 AM7/11/15
to django-...@googlegroups.com
#25108: Tests fails when using Pillow 2.9.0
---------------------------+----------------------------

Reporter: double-y | Owner: nobody
Type: Bug | Status: new
Component: HTTP handling | Version: master
Severity: Normal | Resolution:

Keywords: test | Triage Stage: Unreviewed
Has patch: 1 | Easy pickings: 0
UI/UX: 0 |
---------------------------+----------------------------
Changes (by double-y):

* Attachment "25108.diff" added.

Django

unread,
Jul 11, 2015, 11:04:56 AM7/11/15
to django-...@googlegroups.com
#25108: Tests fails when using Pillow 2.9.0
-------------------------------+--------------------------------------
Reporter: double-y | Owner: double-y
Type: Bug | Status: assigned

Component: HTTP handling | Version: master
Severity: Normal | Resolution:

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

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by double-y):

* owner: nobody => double-y
* needs_better_patch: => 0
* status: new => assigned
* needs_tests: => 0
* needs_docs: => 0


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

Django

unread,
Jul 11, 2015, 8:33:15 PM7/11/15
to django-...@googlegroups.com
#25108: Tests fails when using Pillow 2.9.0
--------------------------+------------------------------------

Reporter: double-y | Owner: double-y
Type: Bug | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: test | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1
* component: HTTP handling => Forms
* stage: Unreviewed => Accepted


Comment:

The original purpose of this test is to check the case when Pillow doesn't
detect the MIME type of the image, so we need to find a new case of that
if possible.

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

Django

unread,
Jul 11, 2015, 9:26:38 PM7/11/15
to django-...@googlegroups.com
#25108: Tests fails when using Pillow 2.9.0
--------------------------+------------------------------------
Reporter: double-y | Owner: double-y
Type: Bug | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: test | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by double-y):

Then, should I choose a different type of image which Pillow doesn't
detect the MIME type?

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

Django

unread,
Jul 11, 2015, 9:36:09 PM7/11/15
to django-...@googlegroups.com
#25108: Tests fails when using Pillow 2.9.0
--------------------------+------------------------------------
Reporter: double-y | Owner: double-y
Type: Bug | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: test | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by double-y):

Replying to [comment:2 timgraham]:
> The original purpose of this test is to check the case when Pillow
doesn't detect the MIME type of the image, so we need to find a new case
of that if possible.

Then, should I choose a different type of image which Pillow doesn't
detect the MIME type? Or can I set file extension which doesn't exist?

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

Django

unread,
Jul 12, 2015, 12:04:41 AM7/12/15
to django-...@googlegroups.com
#25108: Tests fails when using Pillow 2.9.0
--------------------------+------------------------------------
Reporter: double-y | Owner: double-y
Type: Bug | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: test | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by double-y):

I found a tga file can be ImageFile and its MIME type is not detected, so
I changed bmp to tga.

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

Django

unread,
Jul 12, 2015, 5:24:52 AM7/12/15
to django-...@googlegroups.com
#25108: Tests fails when using Pillow 2.9.0
--------------------------+------------------------------------
Reporter: double-y | Owner: double-y
Type: Bug | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: test | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by coldmind):

Yes, after previous ticket I added MIME for BMP, so it will fail.
I think it is better to use mock to model this situation instead of fixing
every time after Pillow registers MIME for image plugin without it.

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

Django

unread,
Jul 13, 2015, 2:59:02 PM7/13/15
to django-...@googlegroups.com
#25108: Tests fails when using Pillow 2.9.0
--------------------------+------------------------------------
Reporter: double-y | Owner: double-y
Type: Bug | Status: closed
Component: Forms | Version: master
Severity: Normal | Resolution: fixed

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

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

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


Comment:

In [changeset:"a2b999dfcac9bc92513a36ec6b3033ded1561c66" a2b999d]:
{{{
#!CommitTicketReference repository=""
revision="a2b999dfcac9bc92513a36ec6b3033ded1561c66"
Fixed #25108 -- Fixed a test which failed on Pillow 2.9+
}}}

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

Django

unread,
Jul 13, 2015, 3:09:38 PM7/13/15
to django-...@googlegroups.com
#25108: Tests fails when using Pillow 2.9.0
--------------------------+------------------------------------
Reporter: double-y | Owner: double-y
Type: Bug | Status: closed
Component: Forms | Version: master
Severity: Normal | Resolution: fixed
Keywords: test | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

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

In [changeset:"269315d81a955b9352777961a76763a47fb61667" 269315d8]:
{{{
#!CommitTicketReference repository=""
revision="269315d81a955b9352777961a76763a47fb61667"
[1.8.x] Fixed #25108 -- Fixed a test which failed on Pillow 2.9+

Backport of a2b999dfcac9bc92513a36ec6b3033ded1561c66 from master
}}}

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

Reply all
Reply to author
Forward
0 new messages