Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Py3: Correct use of string instead of bytes #15

Open
wants to merge 2 commits into
base: py3
Choose a base branch
from

Conversation

kushal-kumaran
Copy link

Fixes this traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pyPdf/pdf.py", line 861, in decrypt
    return self._decrypt(password)
  File "pyPdf/pdf.py", line 866, in _decrypt
    encrypt = self.trailer['/Encrypt'].getObject()
  File "pyPdf/generic.py", line 476, in __getitem__
    return dict.__getitem__(self, key).getObject()
  File "pyPdf/generic.py", line 165, in getObject
    return self.pdf.getObject(self).getObject()
  File "pyPdf/pdf.py", line 616, in getObject
    retval = readObject(self.stream, self)
  File "pyPdf/generic.py", line 66, in readObject
    return DictionaryObject.readFromStream(stream, pdf)
  File "pyPdf/generic.py", line 527, in readFromStream
    value = readObject(stream, pdf)
  File "pyPdf/generic.py", line 51, in readObject
    return readStringFromStream(stream)
  File "pyPdf/generic.py", line 337, in readStringFromStream
    txt.extend(tok)
TypeError: an integer is required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant