Container: handle internal hrefs that result in ValueError when try to resolve them on windows

This commit is contained in:
Kovid Goyal 2022-07-25 18:45:54 +05:30
parent f2572a36cd
commit bd7aa63c14
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -118,7 +118,10 @@ def href_to_name(href, root, base=None):
# assume all such paths are invalid/absolute paths. # assume all such paths are invalid/absolute paths.
return None return None
fullpath = os.path.join(base, *href.split('/')) fullpath = os.path.join(base, *href.split('/'))
try:
return unicodedata.normalize('NFC', abspath_to_name(fullpath, root)) return unicodedata.normalize('NFC', abspath_to_name(fullpath, root))
except ValueError:
return None
class ContainerBase: # {{{ class ContainerBase: # {{{