From 4563cc1468f9ce313cfaa535f709711c3763a46d Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Tue, 2 Aug 2011 10:12:20 +0200 Subject: Decode uploaded files data. There were some UnicodeDecodeErrors happening when a file with non-ascii chars was uploaded. files[..].read() returns a string. --- extras/appengine/sqlformat/legacy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extras/appengine/sqlformat') diff --git a/extras/appengine/sqlformat/legacy.py b/extras/appengine/sqlformat/legacy.py index bf137fb..9d53479 100644 --- a/extras/appengine/sqlformat/legacy.py +++ b/extras/appengine/sqlformat/legacy.py @@ -105,7 +105,7 @@ def _get_examples(): def _get_sql(data, files=None): sql = None if files is not None and 'datafile' in files: - sql = files['datafile'].read() + sql = files['datafile'].read().decode('utf-8') if not sql: sql = data.get('data') return sql or '' -- cgit v1.2.1