From d4cf870ff7f717bb62d9d681e342305c345dcece Mon Sep 17 00:00:00 2001 From: David Bailey Date: Sun, 6 Aug 2017 18:03:00 +0100 Subject: [PATCH] Fix error when dropping/pasting media file with a hash in its name --- aqt/editor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aqt/editor.py b/aqt/editor.py index 999bea967..6183abfb9 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -544,8 +544,8 @@ to a cloze type first, via Edit>Change Note Type.""")) def _retrieveURL(self, url): "Download file into media folder and return local filename or None." # urllib doesn't understand percent-escaped utf8, but requires things like - # '#' to be escaped. we don't try to unquote the incoming URL, because - # we should only be receiving file:// urls from url mime, which is unquoted + # '#' to be escaped. + url = urllib.parse.unquote(url) if url.lower().startswith("file://"): url = url.replace("%", "%25") url = url.replace("#", "%23")