Skip to content

Commit 695185b

Browse files
committed
Update __main__.py
Fixed bug when salt is randomly generated and not properly saved
1 parent 6f57dc4 commit 695185b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

PyPassword/__main__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,11 @@ def check_files():
9191
if custom_salt == '':
9292
custom_salt = os.urandom(16)
9393

94+
else:
95+
custom_salt = "b'" + custom_salt + "'"
96+
9497
with open(file('settings.py'), 'w') as f:
95-
f.write(f"# -*- coding: utf-8 -*-\nsalt = b'{custom_salt}'\n")
98+
f.write(f"# -*- coding: utf-8 -*-\nsalt = {custom_salt}\n")
9699
finally:
97100
print('Settings OK!')
98101

0 commit comments

Comments
 (0)