From d7dad5e6c7b8e3503b4fdec4fce1e48cc14a418f Mon Sep 17 00:00:00 2001 From: canyonknight Date: Mon, 17 Dec 2012 01:13:23 +0000 Subject: 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 Signed-off-by: Lukas Fleischer --- support/schema/gendummydata.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/support/schema/gendummydata.py b/support/schema/gendummydata.py index f3dd8f9..361d1f9 100755 --- a/support/schema/gendummydata.py +++ b/support/schema/gendummydata.py @@ -87,7 +87,7 @@ def genFortune(): # load the words, and make sure there are enough words for users/pkgs # log.debug("Grabbing words from seed file...") -fp = open(SEED_FILE, "r") +fp = open(SEED_FILE, "r", encoding="utf-8") contents = fp.readlines() fp.close() if MAX_USERS > len(contents): @@ -142,7 +142,7 @@ has_tus = 0 # 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") # 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("Gathering text from fortune file...") -fp = open(FORTUNE_FILE, "r") +fp = open(FORTUNE_FILE, "r", encoding="utf-8") fortunes = fp.read().split("%\n") fp.close() -- cgit v1.2.3-70-g09d2