From 6e8a0cc4d175dd9a4572f1207ef6e5be9e2fdfe5 Mon Sep 17 00:00:00 2001 From: Venelin Stoykov Date: Wed, 22 Apr 2015 22:56:40 +0300 Subject: [PATCH] Fixes #145 - Syntax Error on Python 3.2 This correctly reimplement pull #168 --- ckeditor/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ckeditor/utils.py b/ckeditor/utils.py index eb8dff8..c46a40d 100644 --- a/ckeditor/utils.py +++ b/ckeditor/utils.py @@ -5,6 +5,7 @@ import string from django.core.files.storage import default_storage from django.template.defaultfilters import slugify +from django.utils.encoding import force_text class NotAnImageException(Exception): @@ -32,7 +33,7 @@ def get_thumb_filename(file_name): Generate thumb filename by adding _thumb to end of filename before . (if present) """ - return unicode('{0}_thumb{1}').format(*os.path.splitext(file_name)) + return force_text('{0}_thumb{1}').format(*os.path.splitext(file_name)) def get_image_format(extension):