parser as utf

This commit is contained in:
Ville Rantanen
2018-12-13 15:38:09 +02:00
parent c2eb9c4859
commit df76630553
2 changed files with 2 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ import sqlite3
DATABASE = os.getenv('DATABASE', 'abot.sqlite') # database file DATABASE = os.getenv('DATABASE', 'abot.sqlite') # database file
DEBUG = False DEBUG = True
QUESTIONS = os.getenv('QUESTIONS', 'questions') # path to questions QUESTIONS = os.getenv('QUESTIONS', 'questions') # path to questions
GIT_COMMIT = os.getenv('GIT_COMMIT', False) GIT_COMMIT = os.getenv('GIT_COMMIT', False)

View File

@@ -166,7 +166,7 @@ def parse_form(key):
key = secure_filename(key) key = secure_filename(key)
try: try:
current_question = 0 current_question = 0
with open(os.path.join(app.config['QUESTIONS'], key + ".txt"), "rt") as fp: with open(os.path.join(app.config['QUESTIONS'], key + ".txt"), "rt", encoding = "UTF-8") as fp:
for row in fp: for row in fp:
if row.strip() == "": if row.strip() == "":
continue continue