Fixes #261 and generally supports Unicode better in Python 2 (#263)

* Fixing #261 and improving Unicode in Python2
* Fixing PEP8 issues
This commit is contained in:
Kevin Chung
2017-05-21 12:43:31 -04:00
committed by GitHub
parent 28f669be05
commit 59afacce69
7 changed files with 80 additions and 13 deletions

View File

@@ -231,7 +231,7 @@ if __name__ == '__main__':
for x in range(AMT_CHALS_WITH_FILES):
chal = random.randint(1, CHAL_AMOUNT)
filename = gen_file()
md5hash = hashlib.md5(filename).hexdigest()
md5hash = hashlib.md5(filename.encode('utf-8')).hexdigest()
db.session.add(Files(chal, md5hash + '/' + filename))
db.session.commit()