mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
gendummydata.py: Open all files with UTF-8 encoding
Users with certain locales are unable to generate dummy data. Enforce UTF-8 encoding. Fixes FS#32986 Signed-off-by: canyonknight <canyonknight@gmail.com> Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
cc1a0776c5
commit
d7dad5e6c7
1 changed files with 3 additions and 3 deletions
|
@ -87,7 +87,7 @@ def genFortune():
|
||||||
# load the words, and make sure there are enough words for users/pkgs
|
# load the words, and make sure there are enough words for users/pkgs
|
||||||
#
|
#
|
||||||
log.debug("Grabbing words from seed file...")
|
log.debug("Grabbing words from seed file...")
|
||||||
fp = open(SEED_FILE, "r")
|
fp = open(SEED_FILE, "r", encoding="utf-8")
|
||||||
contents = fp.readlines()
|
contents = fp.readlines()
|
||||||
fp.close()
|
fp.close()
|
||||||
if MAX_USERS > len(contents):
|
if MAX_USERS > len(contents):
|
||||||
|
@ -142,7 +142,7 @@ has_tus = 0
|
||||||
|
|
||||||
# Just let python throw the errors if any happen
|
# Just let python throw the errors if any happen
|
||||||
#
|
#
|
||||||
out = open(sys.argv[1], "w")
|
out = open(sys.argv[1], "w", encoding="utf-8")
|
||||||
out.write("BEGIN;\n")
|
out.write("BEGIN;\n")
|
||||||
|
|
||||||
# Begin by creating the User statements
|
# Begin by creating the User statements
|
||||||
|
@ -180,7 +180,7 @@ log.debug("Number of users: %d" % (MAX_USERS-len(developers)-len(trustedusers)))
|
||||||
log.debug("Number of packages: %d" % MAX_PKGS)
|
log.debug("Number of packages: %d" % MAX_PKGS)
|
||||||
|
|
||||||
log.debug("Gathering text from fortune file...")
|
log.debug("Gathering text from fortune file...")
|
||||||
fp = open(FORTUNE_FILE, "r")
|
fp = open(FORTUNE_FILE, "r", encoding="utf-8")
|
||||||
fortunes = fp.read().split("%\n")
|
fortunes = fp.read().split("%\n")
|
||||||
fp.close()
|
fp.close()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue