commit 7b14516cc0e9d26ec3be63f98ead5660359aa8c8
parent 8cb714fb70ed5266a4c02924d9bd22c44cccead7
Author: ThomasV <thomasv@electrum.org>
Date: Sun, 27 Aug 2017 09:53:22 +0200
fix unicode in make_seed and getseed
Diffstat:
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/commands.py b/lib/commands.py
@@ -164,9 +164,9 @@ class Commands:
@command('')
def make_seed(self, nbits=132, entropy=1, language=None):
"""Create a seed"""
- from mnemonic import Mnemonic
+ from .mnemonic import Mnemonic
s = Mnemonic(language).make_seed('standard', nbits, custom_entropy=entropy)
- return s.encode('utf8')
+ return s
@command('')
def check_seed(self, seed, entropy=1, language=None):
@@ -369,7 +369,7 @@ class Commands:
def getseed(self, password=None):
"""Get seed phrase. Print the generation seed of your wallet."""
s = self.wallet.get_seed(password)
- return s.encode('utf8')
+ return s
@command('wp')
def importprivkey(self, privkey, password=None):
diff --git a/lib/mnemonic.py b/lib/mnemonic.py
@@ -86,7 +86,7 @@ def is_CJK(c):
def normalize_text(seed):
# normalize
- seed = unicodedata.normalize('NFKD', str(seed))
+ seed = unicodedata.normalize('NFKD', seed)
# lower
seed = seed.lower()
# remove accents
@@ -100,7 +100,7 @@ def normalize_text(seed):
def load_wordlist(filename):
path = os.path.join(os.path.dirname(__file__), 'wordlist', filename)
s = open(path,'r').read().strip()
- s = unicodedata.normalize('NFKD', s.decode('utf8'))
+ s = unicodedata.normalize('NFKD', s)
lines = s.split('\n')
wordlist = []
for line in lines: