diff --git a/src/calibre/db/notes/exim.py b/src/calibre/db/notes/exim.py index a180b21462..0ff93ac8ca 100644 --- a/src/calibre/db/notes/exim.py +++ b/src/calibre/db/notes/exim.py @@ -5,7 +5,7 @@ import os import shutil from html5_parser import parse from lxml import html -from urllib.parse import urlparse +from urllib.parse import unquote, urlparse from calibre.ebooks.chardet import xml_to_unicode from calibre.utils.cleantext import clean_xml_chars @@ -63,7 +63,7 @@ def import_note(path_to_html_file: str, add_resource) -> dict: except Exception: continue if purl.scheme in ('', 'file'): - path = purl.path + path = unquote(purl.path) if not os.path.isabs(path): path = os.path.join(basedir, path) q = os.path.normcase(get_long_path_name(os.path.abspath(path))) diff --git a/src/calibre/db/tests/notes.py b/src/calibre/db/tests/notes.py index ee4df65f44..49805fc241 100644 --- a/src/calibre/db/tests/notes.py +++ b/src/calibre/db/tests/notes.py @@ -124,14 +124,14 @@ def test_cache_api(self: 'NotesTest'): self.assertIsNone(cache.get_notes_resource(h1)) self.assertIsNone(cache.get_notes_resource(h2)) # test exim of note - doc = '
test simple exim of note with resources
. Works or not
test simple exim of note with resources
. Works or not
test simple exim