Skip to content

Commit

Permalink
Merge pull request #257 from yatintaluja/fix-245
Browse files Browse the repository at this point in the history
[MRG] Fix AttributeError for encrypted files
  • Loading branch information
yatintaluja committed Jan 16, 2019
2 parents 45ae980 + 6c4b468 commit 8ea4ec3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions HISTORY.md
Expand Up @@ -4,6 +4,14 @@ Release History
master
------

0.7.2 (2019-01-10)
------------------

**Bugfixes**

* [#245](https://github.com/socialcopsdev/camelot/issues/245) Fix AttributeError for encrypted files. [#251](https://github.com/socialcopsdev/camelot/pull/251) by Yatin Taluja.


0.7.1 (2019-01-06)
------------------

Expand Down
2 changes: 1 addition & 1 deletion camelot/__version__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

VERSION = (0, 7, 1)
VERSION = (0, 7, 2)
PRERELEASE = None # alpha, beta or rc
REVISION = None

Expand Down
3 changes: 2 additions & 1 deletion camelot/handlers.py
Expand Up @@ -33,13 +33,14 @@ def __init__(self, filepath, pages='1', password=None):
self.filepath = filepath
if not filepath.lower().endswith('.pdf'):
raise NotImplementedError("File format not supported")
self.pages = self._get_pages(self.filepath, pages)

if password is None:
self.password = ''
else:
self.password = password
if sys.version_info[0] < 3:
self.password = self.password.encode('ascii')
self.pages = self._get_pages(self.filepath, pages)

def _get_pages(self, filepath, pages):
"""Converts pages string to list of ints.
Expand Down

0 comments on commit 8ea4ec3

Please sign in to comment.