Fix crash in import.py when there are multiple slashes in entry#200
Merged
dnicolodi merged 2 commits intobeancount:masterfrom Jan 7, 2026
Merged
Fix crash in import.py when there are multiple slashes in entry#200dnicolodi merged 2 commits intobeancount:masterfrom
dnicolodi merged 2 commits intobeancount:masterfrom
Conversation
Collaborator
|
The example is just an example that should handle only the example data. How do you run into a issue with it? |
Contributor
Author
|
People use examples as templates. I copied it to use on other data and ran into the problem. |
00289e8 to
c07da88
Compare
This code escapes its demonstrative purpose and is copied into user setups. Fix the import hook to be robust against narration containing multiple slashes. Splitting on the last slash is arbitrary but good as any other choice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
examples/import.pycurrently crashes when the entry has more than one slash. For example, I ran into this:This patch splits on the last slash which is a compromise but better than splitting on the first, I think.