From 81d898040cd7eee1c1ef2f7c45e39bc1ecd89c3d Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Sat, 27 Sep 2014 00:43:37 +0200 Subject: [PATCH] Fix unicode no more exist on py3. --- sigal/gallery.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sigal/gallery.py b/sigal/gallery.py index 4d90965..9a0036e 100644 --- a/sigal/gallery.py +++ b/sigal/gallery.py @@ -39,7 +39,7 @@ from os.path import isfile, join, splitext from PIL import Image as PILImage from . import image, video, signals -from .compat import UnicodeMixin, strxfrm, url_quote +from .compat import UnicodeMixin, strxfrm, url_quote, text_type from .image import process_image, get_exif_tags, get_exif_data from .settings import get_thumb from .utils import (Devnull, copy, check_or_create_dir, url_from_path, @@ -550,7 +550,7 @@ class Gallery(object): # 63 is the total length of progressbar, label, percentage, etc available_length = get_terminal_size()[0] - 64 if x and available_length > 10: - return unicode(x.name)[:available_length].encode('utf-8') + return text_type(x.name)[:available_length].encode('utf-8') else: return ""