When applying the example.py script to some PDF files, I've been getting errors -
"Title": [lambda value: value.upper()], AttributeError: 'NoneType' object has no attribute 'upper'
I've found what I think is a simple fix for this - checking if the value is None in line 155 of pdf_redactor.py:
# Filter the value. if value is not None: value = f(value)
Not sure about the etiquette of submitting a PR, but would like to do so - this has fixed the issues I've had when working on a number of PDFs using redactor.
But the change would change the functionality of the library. I'd suggest changing your lambda function instead to e.g. value.upper() if value else None.
When applying the example.py script to some PDF files, I've been getting errors -
"Title": [lambda value: value.upper()], AttributeError: 'NoneType' object has no attribute 'upper'
I've found what I think is a simple fix for this - checking if the value is None in line 155 of pdf_redactor.py:
# Filter the value. if value is not None: value = f(value)
Not sure about the etiquette of submitting a PR, but would like to do so - this has fixed the issues I've had when working on a number of PDFs using redactor.