From: Radek Czajka Date: Tue, 12 Mar 2019 09:33:12 +0000 (+0100) Subject: Fix for picture in Python 3. X-Git-Tag: 1.7.2 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/6158510771a90d29d0d4eddb311bed6ae367ecf9?hp=8fefa7358bf9f799c8a7d700b58a00362b26419e Fix for picture in Python 3. --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a18029..6a3f7a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ This document records all notable changes to Librarian. +## 1.7.2 (2019-03-12) + +### Fixed +- Fix for Picture in Python 3: open image in binary mode. + + ## 1.7.1 (2019-03-01) ### Fixed diff --git a/librarian/picture.py b/librarian/picture.py index d255f55..10d2ae7 100644 --- a/librarian/picture.py +++ b/librarian/picture.py @@ -154,7 +154,7 @@ class WLPicture(object): return self.image_store.path(self.slug, self.mime_type) def image_file(self, *args, **kwargs): - return open(self.image_path, *args, **kwargs) + return open(self.image_path, 'rb', *args, **kwargs) def get_sem_coords(self, sem): area = sem.find("div[@type='rect']") diff --git a/setup.py b/setup.py index 111e83b..d1569ce 100755 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ def whole_tree(prefix, path): setup( name='librarian', - version='1.7.1', + version='1.7.2', description='Converter from WolneLektury.pl XML-based language to XHTML, TXT and other formats', author="Marek Stępniowski", author_email='marek@stepniowski.com',