pdfminer / pdfminer.six

Community maintained fork of pdfminer - we fathom PDF
https://pdfminersix.readthedocs.io
MIT License
5.96k stars 930 forks source link

Always return a `str` from `literal_name` #978

Closed pietermarsman closed 4 months ago

pietermarsman commented 4 months ago

Pull request

This is what happened in practice for correct input (e.g. PSLiteral). But now it also always returns a str when the object is not a PSLiteral.

This fixes #977 because it makes the literal name object hashable. This sample PDF will now crash with a PDFSyntaxError. That's good.

How Has This Been Tested?

With the PDF from #977. And with nox.

Checklist