Browse Source

Merge pull request #237 from SimonSapin/master

A fix for send_file with unicode filenames.
pull/245/merge
Armin Ronacher 14 years ago
parent
commit
46ecc57b7c
  1. 5
      flask/helpers.py

5
flask/helpers.py

@ -379,7 +379,10 @@ def send_file(filename_or_fp, mimetype=None, as_attachment=False,
rv.set_etag('flask-%s-%s-%s' % (
os.path.getmtime(filename),
os.path.getsize(filename),
adler32(filename) & 0xffffffff
adler32(
filename.encode('utf8') if isinstance(filename, unicode)
else filename
) & 0xffffffff
))
if conditional:
rv = rv.make_conditional(request)

Loading…
Cancel
Save