You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An exception is thrown when decoding objects with a ASCIIHEXCodec:
fdata = fobj.getData()
File "c:\users\dcmvd\documents\github\pypdf4\pypdf\generic.py", line 950, in getData
decoded._data = decodeStreamData(self)
File "c:\users\dcmvd\documents\github\pypdf4\pypdf\filters.py", line 757, in decodeStreamData
data = ASCIIHexCodec.decode(data)
File "c:\users\dcmvd\documents\github\pypdf4\pypdf\filters.py", line 249, in decode
elif c.isspace():
AttributeError: 'int' object has no attribute 'isspace'
This is likely legacy Py2 code that was not updated to Py3. The problem can be solved easily by converting data to string in the beginning of the method:
try:
data = data.decode()
except(AttributeError):
pass
And converting the return value to str/byte depending on which python version is running at the end of the method:
retval = b_(retval)
The text was updated successfully, but these errors were encountered:
An exception is thrown when decoding objects with a ASCIIHEXCodec:
This is likely legacy Py2 code that was not updated to Py3. The problem can be solved easily by converting data to string in the beginning of the method:
And converting the return value to str/byte depending on which python version is running at the end of the method:
The text was updated successfully, but these errors were encountered: