mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 06:07:11 -05:00
normalize filenames in colpkg import
This commit is contained in:
parent
b04c2212b5
commit
fad6b244cd
1 changed files with 2 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ import re
|
||||||
import traceback
|
import traceback
|
||||||
import zipfile
|
import zipfile
|
||||||
import json
|
import json
|
||||||
|
import unicodedata
|
||||||
|
|
||||||
from aqt.qt import *
|
from aqt.qt import *
|
||||||
import anki.importing as importing
|
import anki.importing as importing
|
||||||
|
|
@ -405,7 +406,7 @@ def _replaceWithApkg(mw, file, backup):
|
||||||
mw.progress.update(ngettext("Processed %d media file",
|
mw.progress.update(ngettext("Processed %d media file",
|
||||||
"Processed %d media files", n) % n)
|
"Processed %d media files", n) % n)
|
||||||
size = z.getinfo(cStr).file_size
|
size = z.getinfo(cStr).file_size
|
||||||
dest = os.path.join(d, file)
|
dest = os.path.join(d, unicodedata.normalize("NFC", file))
|
||||||
# if we have a matching file size
|
# if we have a matching file size
|
||||||
if os.path.exists(dest) and size == os.stat(dest).st_size:
|
if os.path.exists(dest) and size == os.stat(dest).st_size:
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue