diff --git a/src/wormhole/codes.py b/src/wormhole/codes.py index a911f85..340fa03 100644 --- a/src/wormhole/codes.py +++ b/src/wormhole/codes.py @@ -102,5 +102,6 @@ def input_code_with_completion(prompt, initial_channelids, get_channel_ids, return code if __name__ == "__main__": - code = input_code_with_completion("Enter wormhole code: ", lambda: [], 2) + code = input_code_with_completion("Enter wormhole code: ", + [], lambda: [], 2) print("code is:", code) diff --git a/src/wormhole/wordlist.py b/src/wormhole/wordlist.py index 3da0cff..fe6c50c 100644 --- a/src/wormhole/wordlist.py +++ b/src/wormhole/wordlist.py @@ -139,11 +139,11 @@ raw_words = { 'FE': ['woodlark', 'yesteryear'], 'FF': ['Zulu', 'Yucatan'] }; -byte_to_even_word = dict([(unhexlify(k), both_words[0]) +byte_to_even_word = dict([(unhexlify(k.encode("ascii")), both_words[0]) for k,both_words in raw_words.items()]) -byte_to_odd_word = dict([(unhexlify(k), both_words[1]) +byte_to_odd_word = dict([(unhexlify(k.encode("ascii")), both_words[1]) for k,both_words in raw_words.items()]) even_words_lowercase, odd_words_lowercase = set(), set() @@ -152,7 +152,7 @@ for k,both_words in raw_words.items(): even_word, odd_word = both_words even_words_lowercase.add(even_word.lower()) - even_words_lowercase_to_byte[even_word.lower()] = unhexlify(k) + even_words_lowercase_to_byte[even_word.lower()] = unhexlify(k.encode("ascii")) odd_words_lowercase.add(odd_word.lower()) - odd_words_lowercase_to_byte[odd_word.lower()] = unhexlify(k) + odd_words_lowercase_to_byte[odd_word.lower()] = unhexlify(k.encode("ascii"))