claird / PyPDF4

A utility to read and write PDFs with Python
obsolete-https://pythonhosted.org/PyPDF2/
Other
328 stars 61 forks source link

ASCII85 decoder must ignore whitespace characters #51

Closed kurtmckee closed 5 years ago

kurtmckee commented 5 years ago

The ASCII85 decoder currently throws a ValueError when it encounters a space, rather than ignoring the character. This appears to be incorrect behavior, and is reinforced by an existing invalidity test that excludes several whitespace characters from the test (though their validity was not also tested).

This is important because once Python 2 support is dropped the implementation can simply use base64.a85encode(data, adobe=True), so matching this code now will help prepare PyPDF4 to drop Python 2 support.