Skip to content

Commit 27f992c

Browse files
authored
Merge pull request #193 from techdavid/fix-paste-url-with-hash
Fix error when dropping/pasting media file with a hash in its name
2 parents 3bd6e18 + d4cf870 commit 27f992c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aqt/editor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,8 @@ def isURL(self, s):
544544
def _retrieveURL(self, url):
545545
"Download file into media folder and return local filename or None."
546546
# urllib doesn't understand percent-escaped utf8, but requires things like
547-
# '#' to be escaped. we don't try to unquote the incoming URL, because
548-
# we should only be receiving file:// urls from url mime, which is unquoted
547+
# '#' to be escaped.
548+
url = urllib.parse.unquote(url)
549549
if url.lower().startswith("file://"):
550550
url = url.replace("%", "%25")
551551
url = url.replace("#", "%23")

0 commit comments

Comments
 (0)