Uh oh!
There was an error while loading. Please reload this page.
Fix Japanese delimiter bug - #110
Merged
Merged
Conversation
Add Czech and Portuguese wordlist. Fix Japanese delimiter bug.
Fix Japanese delimiter bug
LucienSong
commented
May 25, 2023
ContributorAuthor
When generate mnemonics in Japanese, the delimiter is |
Fix Japanese delimiter bug. And add Czech and Portuguese wordlist.
Fix Japanese delimiter bug. And add Czech and Portuguese wordlist.
Closed
prusnak
commented
Aug 13, 2023
Member
I reverted the commit 71cf520 because it failes in the CI. See https://github.com/trezor/python-mnemonic/actions/runs/5849364691/job/15857611745 as one instance. @LucienSong please try fixing the issue again, but this time make sure the CI does not fail. |
This was referenced Aug 5, 2026
fametrano added a commit
to fametrano/python-mnemonic
that referenced
this pull request
Aug 13, 2026
to_mnemonic joins a japanese mnemonic with U+3000 while to_entropy, check and expand split on " ", so the library cannot read the sentences it writes: to_entropy raises on all 24 japanese vectors of vectors.json and expand returns the sentence unchanged. The separator is read after NFKD, which maps U+3000 to U+0020, so it cannot be self.delimiter -- that was trezor#110, reverted in df3e150 for failing CI. What is left to split on is any run of whitespace, which is what detect_language already reads. to_seed follows the same rule, so that a sentence check refuses no longer stretches into a different seed in silence. The tests fail without the fix: to_entropy raises on every japanese vector, check refuses a sentence separated by anything but one space, and expand hands back a tab- or U+3000-separated sentence unexpanded. The existing round trip hides the first by splitting the sentence itself before handing it over. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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 freeto 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.
Fix Japanese delimiter bug.
And add Czech and Portuguese wordlist.