diff --git a/beetsplug/web/__init__.py b/beetsplug/web/__init__.py index 00718dbfb..635c2f5a8 100644 --- a/beetsplug/web/__init__.py +++ b/beetsplug/web/__init__.py @@ -217,8 +217,14 @@ def all_items(): @app.route('/item//file') def item_file(item_id): item = g.lib.get_item(item_id) - item_path = util.syspath(item.path) if (os.name == 'nt') else ( - util.py3_path(item.path)) + + # On Windows under Python 2, Flask wants a Unicode path. On Python 3, it + # *always* wants a Unicode path. + if os.name == 'nt': + item_path = util.syspath(item.path) + else: + item_path = util.py3_path(item.path) + response = flask.send_file( item_path, as_attachment=True,