Commit 1f40006d authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

python3: fix download op for 2/3

parent 87a1b393
...@@ -337,10 +337,9 @@ def edit(resnum): ...@@ -337,10 +337,9 @@ def edit(resnum):
else: else:
filename = os.path.basename(path) filename = os.path.basename(path)
bottle.response.headers['Content-Disposition'] = \ bottle.response.headers['Content-Disposition'] = \
'attachment; filename="%s"' % filename.encode('utf-8') 'attachment; filename="%s"' % filename
path = path.encode('utf-8')
bottle.response.headers['Content-Length'] = os.stat(path).st_size bottle.response.headers['Content-Length'] = os.stat(path).st_size
f = open(path, 'r') f = open(path, 'rb')
if pathismine: if pathismine:
os.unlink(path) os.unlink(path)
return f return f
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment