Merge pull request #237 from SimonSapin/master
A fix for send_file with unicode filenames.
This commit is contained in:
commit
46ecc57b7c
1 changed files with 4 additions and 1 deletions
|
|
@ -379,7 +379,10 @@ def send_file(filename_or_fp, mimetype=None, as_attachment=False,
|
||||||
rv.set_etag('flask-%s-%s-%s' % (
|
rv.set_etag('flask-%s-%s-%s' % (
|
||||||
os.path.getmtime(filename),
|
os.path.getmtime(filename),
|
||||||
os.path.getsize(filename),
|
os.path.getsize(filename),
|
||||||
adler32(filename) & 0xffffffff
|
adler32(
|
||||||
|
filename.encode('utf8') if isinstance(filename, unicode)
|
||||||
|
else filename
|
||||||
|
) & 0xffffffff
|
||||||
))
|
))
|
||||||
if conditional:
|
if conditional:
|
||||||
rv = rv.make_conditional(request)
|
rv = rv.make_conditional(request)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue