summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Geyso <nico.geyso@fu-berlin.de>2015-02-12 20:43:47 +0100
committerNico Geyso <nico.geyso@fu-berlin.de>2015-02-12 20:43:47 +0100
commit1c5b9f289807bf9b00b292502d5103bfdeb65a80 (patch)
tree44b1b371ece96494350e574e8d31214cd019c92b
parent21736620dd994791cb7e0c43f1bcd1cb636488bc (diff)
downloadklausuren-1c5b9f289807bf9b00b292502d5103bfdeb65a80.tar.gz
klausuren-1c5b9f289807bf9b00b292502d5103bfdeb65a80.tar.bz2
klausuren-1c5b9f289807bf9b00b292502d5103bfdeb65a80.zip
backend - fix UnicodeDecodeError
Fix UnicodeDecodeError when performing os.walk in get_exams(). Default encoding for python is ascii but in linux it's utf-8.
-rw-r--r--app/backend.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/backend.py b/app/backend.py
index 0dbebb8..e601c0c 100644
--- a/app/backend.py
+++ b/app/backend.py
@@ -35,7 +35,7 @@ class Storage:
def get_exams(self, name):
""" Lists all exams of a given course """
# loop over all directories which do not contain any subdirs
- for root, dirs, files in os.walk(self._join(name)):
+ for root, dirs, files in os.walk(self._join(name).encode('utf-8')):
if len(dirs) == 0:
# metainformation is encoded in path: course/year/exam.pdf
splitted = root.split(os.path.sep)