Skip to content

Commit d6a3aa7

Browse files
committed
Correct encoding for Windows
1 parent 37f9fff commit d6a3aa7

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
base58 >=2.0.1, <3
22
chacha20poly1305>=0.0.3
3-
fpdf2 >=2.5, <3
3+
fpdf2 >=2.5.7,<3
44
hdwallet >=2.1, <3
55
mnemonic >=0.2, <1
66
qrcode >=7.3

slip39/gui/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ def app(
11771177
txt_name = '-'.join( [ 'SLIP', '39' ] + txt_segs[:txt_i] ) + '.txt'
11781178
txt_path = os.path.join( os.path.dirname( __file__ ), txt_name )
11791179
try:
1180-
with open( txt_path, 'r', encoding='utf-8' ) as txt_f:
1180+
with open( txt_path, 'r', encoding='UTF-8' ) as txt_f:
11811181
txt = txt_f.read()
11821182
if txt:
11831183
instructions = txt

slip39/layout/pdf.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def set_font( self, family=None, style="", size=0 ):
121121
log.info( f"Font named {family=} + {features=} no match: {fname}" )
122122
if fname_best:
123123
log.warning( f"Font named {family=} + {features=} loading: {fname_best} (as '{family}{style}')" )
124-
self.add_font( family=family, style=style, fname=fname_best )
124+
self.add_font( family=family, style=style, fname=str( fname_best ))
125125
log.debug( f"Fonts now: {commas( self.fonts, final_and=True )}" )
126126
else:
127127
log.warning( f"Font name {family=} and {features=} not found for: {fontkey}" )
@@ -404,7 +404,7 @@ def write_pdfs(
404404
group_threshold = group_threshold,
405405
groups = groups,
406406
master_secret = master_secret,
407-
passphrase = passphrase.encode( 'utf-8' ) if passphrase else b'',
407+
passphrase = passphrase.encode( 'UTF-8' ) if passphrase else b'',
408408
using_bip39 = using_bip39, # Derive wallet Seed using BIP-39 Mnemonic + passphrase generation
409409
cryptopaths = cryptopaths,
410410
)
@@ -418,11 +418,11 @@ def write_pdfs(
418418

419419
cover_text = None
420420
if cover_page:
421-
cover_text = open(os.path.join(os.path.dirname(__file__), 'COVER.txt')).read()
421+
cover_text = open(os.path.join(os.path.dirname(__file__), 'COVER.txt'), encoding='UTF-8').read()
422422
if using_bip39:
423-
cover_text += open(os.path.join(os.path.dirname(__file__), 'COVER-BIP-39.txt')).read()
423+
cover_text += open(os.path.join(os.path.dirname(__file__), 'COVER-BIP-39.txt', ), encoding='UTF-8').read()
424424
else:
425-
cover_text += open(os.path.join(os.path.dirname(__file__), 'COVER-SLIP-39.txt')).read()
425+
cover_text += open(os.path.join(os.path.dirname(__file__), 'COVER-SLIP-39.txt'), encoding='UTF-8').read()
426426

427427
# Generate each desired SLIP-39 Mnemonic cards PDF. Supports --card (the default). Remember
428428
# any deduced orientation and paper_format for below.

slip39/recovery/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def main( argv=None ):
9797
passphrase = input_secure( 'Master seed passphrase: ', secret=True )
9898
elif passphrase:
9999
log.warning( "It is recommended to not use '-p|--passphrase <password>'; specify '-' to read from input" )
100-
passphrase = passphrase.encode( 'utf-8' )
100+
passphrase = passphrase.encode( 'UTF-8' )
101101

102102
# If BIP-39 recovery designated, only a single mnemonic is allowed:
103103
secret = None

0 commit comments

Comments
 (0)