mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-18 19:20:08 +02:00
init: fix writing into file
This commit is contained in:
parent
da258dad57
commit
a78341d8e5
@ -338,9 +338,9 @@ def write_password_file(pwtype, password=None):
|
|||||||
filename = '.fdroid.' + pwtype + '.txt'
|
filename = '.fdroid.' + pwtype + '.txt'
|
||||||
fd = os.open(filename, os.O_CREAT | os.O_TRUNC | os.O_WRONLY, 0o600)
|
fd = os.open(filename, os.O_CREAT | os.O_TRUNC | os.O_WRONLY, 0o600)
|
||||||
if password is None:
|
if password is None:
|
||||||
os.write(fd, config[pwtype])
|
os.write(fd, config[pwtype].encode('utf-8'))
|
||||||
else:
|
else:
|
||||||
os.write(fd, password)
|
os.write(fd, password.encode('utf-8'))
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
config[pwtype + 'file'] = filename
|
config[pwtype + 'file'] = filename
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user