Fix for picture in Python 3. 1.7.2
authorRadek Czajka <rczajka@rczajka.pl>
Tue, 12 Mar 2019 09:33:12 +0000 (10:33 +0100)
committerRadek Czajka <rczajka@rczajka.pl>
Tue, 12 Mar 2019 09:33:12 +0000 (10:33 +0100)
CHANGELOG.md
librarian/picture.py
setup.py

index 8a18029..6a3f7a1 100644 (file)
@@ -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
index d255f55..10d2ae7 100644 (file)
@@ -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']")
index 111e83b..d1569ce 100755 (executable)
--- 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',