Skip to content

Commit 44eeb9d

Browse files
author
Buky
authored
Merge pull request jazzband#715 from benspaulding/mimetypes-str
Keep mimetypes as str on all versions of Python
2 parents 46833c6 + 9f08147 commit 44eeb9d

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ or just made Pipeline more awesome.
2121
* Austin Pua <[email protected]>
2222
* Axel Haustant <[email protected]>
2323
* Balazs Kossovics <[email protected]>
24+
* Ben Spaulding <[email protected]>
2425
* Ben Vinegar <[email protected]>
2526
* Brad Pitcher <[email protected]>
2627
* Brant Young <[email protected]>

docs/configuration.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,11 @@ Tuple that match file extension with their corresponding mimetypes.
231231
Defaults to ::
232232

233233
(
234-
(b'text/coffeescript', '.coffee'),
235-
(b'text/less', '.less'),
236-
(b'text/javascript', '.js'),
237-
(b'text/x-sass', '.sass'),
238-
(b'text/x-scss', '.scss')
234+
('text/coffeescript', '.coffee'),
235+
('text/less', '.less'),
236+
('text/javascript', '.js'),
237+
('text/x-sass', '.sass'),
238+
('text/x-scss', '.scss')
239239
)
240240

241241
.. warning::

pipeline/conf.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@
7171
'LESS_ARGUMENTS': '',
7272

7373
'MIMETYPES': (
74-
(b'text/coffeescript', '.coffee'),
75-
(b'text/less', '.less'),
76-
(b'text/javascript', '.js'),
77-
(b'text/x-sass', '.sass'),
78-
(b'text/x-scss', '.scss')
74+
(str('text/coffeescript'), str('.coffee')),
75+
(str('text/less'), str('.less')),
76+
(str('text/javascript'), str('.js')),
77+
(str('text/x-sass'), str('.sass')),
78+
(str('text/x-scss'), str('.scss'))
7979
),
8080

8181
'EMBED_MAX_IMAGE_SIZE': 32700,

tests/tests/test_utils.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
import mimetypes
5+
16
from django.test import TestCase
27

38
from pipeline.utils import guess_type
@@ -8,3 +13,8 @@ def test_guess_type(self):
813
self.assertEqual('text/css', guess_type('stylesheet.css'))
914
self.assertEqual('text/coffeescript', guess_type('application.coffee'))
1015
self.assertEqual('text/less', guess_type('stylesheet.less'))
16+
17+
def test_mimetypes_are_str(self):
18+
for ext, mtype in mimetypes.types_map.items():
19+
self.assertIsInstance(ext, str)
20+
self.assertIsInstance(mtype, str)

0 commit comments

Comments
 (0)