Merge pull request #257 from yatintaluja/fix-245
[MRG] Fix AttributeError for encrypted filespull/2/head v0.7.2
commit
8ea4ec3de8
|
|
@ -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)
|
||||
------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
VERSION = (0, 7, 1)
|
||||
VERSION = (0, 7, 2)
|
||||
PRERELEASE = None # alpha, beta or rc
|
||||
REVISION = None
|
||||
|
||||
|
|
|
|||
|
|
@ -33,13 +33,14 @@ class PDFHandler(object):
|
|||
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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue