From 6158510771a90d29d0d4eddb311bed6ae367ecf9 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 12 Mar 2019 10:33:12 +0100 Subject: [PATCH 1/1] Fix for picture in Python 3. --- CHANGELOG.md | 6 ++++++ librarian/picture.py | 2 +- setup.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) 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', -- 2.20.1