You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Right now, when adding something to the library, it seems to always silently deal with duplicate keys.
Doing this silently is not that perfect.
Right now, it might also cause another issue when actually trying to write such a library: #400
Describe the solution you'd like
Ideally, the handling can be improved (like adding some suffix to the key, as typical for such cases in BibTeX).
Use cases
Sometimes one does just want to add a valid entry and doesn't want to deal with making sure that it could be added successfully.
Describe alternatives you've considered
Manually checking whether the entry has been successfully added after every addition of an entry (or at the end).
Remaining Questions (Optional)
Please tick all that apply:
I would be willing to to contribute a PR to fix this issue.
This issue is a blocker, I'd be greatful for an early fix.
The text was updated successfully, but these errors were encountered:
Doing this silently, and giving a way to check for such errors and resolved them through the failed blocks is done on purpose: When parsing large bibtex files, errors in the file should not interrupt parsing, nor should it swallow the problem. Instead, users should be able to handle these problems after parsing is done. See https://bibtexparser.readthedocs.io/en/main/quickstart.html#step-2-error-checking
We may however improve this for manual addition of blocks by adding an additional boolean parameter exception_on_error to the library.add and library.replace. If true, this flag would cause an exception to be raised whenever a problem (such as a duplicate key) is detected.
Would you be willing to add a PR containing such a change?
Ah, I wasn't aware that the function is also used for parsing.
I think such an exception would be great and to my knowledge, this already exists for the replace function.
Regarding the PR: I am also rather time constrained right now. I guess the code itself won't be too hard to write, but there also needs to be testing involved.
Is your feature request related to a problem? Please describe.
Right now, when adding something to the library, it seems to always silently deal with duplicate keys.
Doing this silently is not that perfect.
Right now, it might also cause another issue when actually trying to write such a library: #400
Describe the solution you'd like
Ideally, the handling can be improved (like adding some suffix to the key, as typical for such cases in BibTeX).
Use cases
Sometimes one does just want to add a valid entry and doesn't want to deal with making sure that it could be added successfully.
Describe alternatives you've considered
Manually checking whether the entry has been successfully added after every addition of an entry (or at the end).
Remaining Questions (Optional)
Please tick all that apply:
The text was updated successfully, but these errors were encountered: