Currently the ASCII85 decoder uses an assert to check whether a 'z' character is found at the start of a new group of characters. However, the assert will be ignored if Python is run with optimizations turned on. Instead, it should throw a ValueError if the 'z' is encountered anywhere other than the start of a new group.
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.
Currently the ASCII85 decoder uses an
assert
to check whether a 'z' character is found at the start of a new group of characters. However, theassert
will be ignored if Python is run with optimizations turned on. Instead, it should throw aValueError
if the 'z' is encountered anywhere other than the start of a new group.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.