mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
Fix error when dropping/pasting media file with a hash in its name
This commit is contained in:
parent
e40445a9c4
commit
d4cf870ff7
1 changed files with 2 additions and 2 deletions
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue