hhru/frontik — Issue #22: Баг в post_url при отравке файлов (2.9.9)
Author: a-tsvetkov
Created: 2011-11-10 12:58:26+00:00
State: open

Если в метод post_url в качестве аргумента files передать словарь с ключами типа unicode (как self.request.files) происходит ошибка:

Traceback (most recent call last):
File "/usr/lib/pymodules/python2.6/tornado/web.py", line 880, in wrapper
return callback(*args, **kwargs)
File "/usr/lib/pymodules/python2.6/frontik/handler.py", line 293, in wrapper
callback(*args, **kwargs)
File "/usr/lib/pymodules/python2.6/frontik/async.py", line 18, in cb
fun(self, *args, **kw)
File "/home/venya/projects/hh.ru-frontend-mirror/xhh/frontik_www/pages/bonus/admin/partner/edit.py", line 71, in post_page
self.post_url(url, data=data, files=self.request.files, callback=_post_partner_cb)
File "/usr/lib/pymodules/python2.6/frontik/handler.py", line 386, in post_url
content_type)
File "/usr/lib/pymodules/python2.6/frontik/util.py", line 136, in make_post_request
body, content_type = make_mfd(data, files)
File "/usr/lib/pymodules/python2.6/frontik/util.py", line 113, in make_mfd
'contenttype': str(get_content_type(file["filename"]))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128)