diff options
| author | Andi Albrecht <albrecht.andi@gmail.com> | 2011-08-02 10:12:20 +0200 |
|---|---|---|
| committer | Andi Albrecht <albrecht.andi@gmail.com> | 2011-08-02 10:12:20 +0200 |
| commit | 4563cc1468f9ce313cfaa535f709711c3763a46d (patch) | |
| tree | cf379a648537e9ab8d5f7e3c5aab97eea300a64d /extras | |
| parent | 718616c4123fcdac4ec2d15eed641f6f80da9600 (diff) | |
| download | sqlparse-4563cc1468f9ce313cfaa535f709711c3763a46d.tar.gz | |
Decode uploaded files data.
There were some UnicodeDecodeErrors happening when a file with
non-ascii chars was uploaded. files[..].read() returns a string.
Diffstat (limited to 'extras')
| -rw-r--r-- | extras/appengine/sqlformat/legacy.py | 2 |
1 files changed, 1 insertions, 1 deletions
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 '' |
