1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-15 09:40:12 +02:00

init: fix writing into file

This commit is contained in:
Daniel Martí 2016-01-04 18:44:46 +01:00
parent da258dad57
commit a78341d8e5

View File

@ -338,9 +338,9 @@ def write_password_file(pwtype, password=None):
filename = '.fdroid.' + pwtype + '.txt'
fd = os.open(filename, os.O_CREAT | os.O_TRUNC | os.O_WRONLY, 0o600)
if password is None:
os.write(fd, config[pwtype])
os.write(fd, config[pwtype].encode('utf-8'))
else:
os.write(fd, password)
os.write(fd, password.encode('utf-8'))
os.close(fd)
config[pwtype + 'file'] = filename