diff --git a/camelot/handlers.py b/camelot/handlers.py index 4955f03..bd4c031 100644 --- a/camelot/handlers.py +++ b/camelot/handlers.py @@ -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.