Commit 738e4fa08a85483c678a3c8f2affda6e4f74d09e

Authored by Miguel Barao
1 parent 6cbdd81d
Exists in master and in 1 other branch dev

- explicit utf-8 encoding opening questions files

Showing 2 changed files with 2 additions and 2 deletions   Show diff stats
questions.py
... ... @@ -56,7 +56,7 @@ class QuestionsPool(dict):
56 56 def add_from_files(self, files, path='.'):
57 57 for filename in files:
58 58 try:
59   - with open(os.path.normpath(os.path.join(path, filename)), 'r') as f:
  59 + with open(os.path.normpath(os.path.join(path, filename)), 'r', encoding='utf-8') as f:
60 60 questions = yaml.load(f)
61 61 except(FileNotFoundError):
62 62 print('[ ERROR ] Questions file "{0}" not found.'.format(filename))
... ...
test.py
... ... @@ -47,7 +47,7 @@ def read_configuration(filename, debug=False, show_points=False, show_hints=Fals
47 47  
48 48 # where to put the students answers (optional)
49 49 if 'answers_dir' not in test:
50   - print('[ WARNG ] Missing "answers_dir" in the test configuration file "{0}".\n Tests are NOT being saved. Grades are still being inserted into the database.'.format(filename))
  50 + print('[ WARNG ] Missing "answers_dir" in the test configuration file "{0}".\n Tests are NOT being saved. Grades are still going into the database.'.format(filename))
51 51 test['save_answers'] = False
52 52 else:
53 53 test['answers_dir'] = os.path.normpath(os.path.expanduser(str(test['answers_dir'])))
... ...