Skip to content

Conversation

@johenglisch
Copy link
Contributor

Database.add_sources expected a BibliographyData object from pybtex specifically and raised a ValueError when it got one from simplepybtex.

Changes made:

  • Fixed Database.add_sources so that you can duck-type either BibliographyData object into it.
  • Made error message more informative.
  • Changed error type from ValueError to TypeError because that just seems more appropriate here.
  • Might as well make the switch from pybtex to simplepybtex.

I think the thing that I'm most unsure about is changing the type of the exception because that's technically changing the API. Then again, users probably shouldn't catch and handle a type error at run time anyways and just pass in the right type to begin with.

@johenglisch johenglisch requested a review from xrotwang June 27, 2025 07:04
@xrotwang xrotwang merged commit 3d2195c into master Jul 2, 2025
4 checks passed
@xrotwang xrotwang deleted the simplepybtex-support branch July 2, 2025 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants