chiark / gitweb /
init: fix writing into file
authorDaniel Martí <mvdan@mvdan.cc>
Mon, 4 Jan 2016 17:44:46 +0000 (18:44 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Thu, 10 Mar 2016 16:43:37 +0000 (16:43 +0000)
fdroidserver/common.py

index 00c3e2f67004e5d5448d3b717557a3c0d8045a8e..ee19776a75997a94f5547801098b6da8c05645cc 100644 (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