| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
InvalidNameError takes name and reason, but its base only stores the formatted message in args, so copy.deepcopy and pickle rebuild it with a single argument and raise TypeError. That surfaces through normal parsing: a failed name is kept in a MiddlewareErrorBlock, and a later middleware like SortBlocksByTypeAndKeyMiddleware deepcopies the library. Store name and reason and add __reduce__ so the exception round-trips.
|
Hi! Gentle nudge on this one whenever you have some bandwidth. It's a small, self-contained fix (Make InvalidNameError copyable and picklable), and it's currently mergeable with no conflicts. No urgency at all, and I'm happy to make any changes you'd like. Thanks for maintaining python-bibtexparser! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
InvalidNameError can't be copied or pickled, which crashes normal parsing:
Its __init__ takes name and reason but the base ValueError only keeps the formatted message in args, so deepcopy/pickle rebuild it with a single argument. This surfaces through the public API: a failed name is stored in a MiddlewareErrorBlock, and a later middleware like SortBlocksByTypeAndKeyMiddleware deepcopies the whole library, so any bad author name plus that middleware raises TypeError out of parse_string. I store name/reason and add __reduce__ so it round-trips. Added a test.