From 0833c820757aa748567eb19251bdebc1303eb74b Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Fri, 12 Aug 2016 19:59:07 +0000 Subject: [PATCH] web: Fix a crash related to byte paths on Python 3 --- beetsplug/web/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/beetsplug/web/__init__.py b/beetsplug/web/__init__.py index baf83f7ca..07e68638b 100644 --- a/beetsplug/web/__init__.py +++ b/beetsplug/web/__init__.py @@ -203,8 +203,11 @@ def all_items(): @app.route('/item//file') def item_file(item_id): item = g.lib.get_item(item_id) - response = flask.send_file(item.path, as_attachment=True, - attachment_filename=os.path.basename(item.path)) + response = flask.send_file( + util.py3_path(item.path), + as_attachment=True, + attachment_filename=os.path.basename(item.path), + ) response.headers['Content-Length'] = os.path.getsize(item.path) return response