colemana/PyPDF2 — pull request #8 by Kelketek (2013-12-13 15:54:54+00:00)
Title: Resiliance modification

While the PDF spec may not be clear on what to do when there are multiple definitions for the dictionary, the principle of 'strict in what you send, tolerant in what you receive' applies here. I've made a tweak to accept only the first definition, and ignore subsequent ones.

To be honest, I'm not entirely sure what this dictionary is for, and I got the basic idea for this fix based on information from some reported Launchpad bug. What I do know is that the majority of people looking to edit a PDF probably aren't concerned about the dictionary enough to abort loading it at all if it fails to validate perfectly. :)

FedEx is an offender here-- pulling the labels from their API gives me this error, and I don't think I'll be able to convince them to change their PDF format, so I figured I might have a better chance with you folks. :)