mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
don't add files with / \ or : to log
This commit is contained in:
parent
a7815856e6
commit
f88bc6ff60
1 changed files with 8 additions and 0 deletions
|
@ -400,6 +400,14 @@ create table log (fname text primary key, type int);
|
|||
continue
|
||||
if f.lower() == "thumbs.db":
|
||||
continue
|
||||
# and files with invalid chars
|
||||
bad = False
|
||||
for c in "\0", "/", "\\", ":":
|
||||
if c in f:
|
||||
bad = True
|
||||
break
|
||||
if bad:
|
||||
continue
|
||||
# empty files are invalid; clean them up and continue
|
||||
if not os.path.getsize(f):
|
||||
os.unlink(f)
|
||||
|
|
Loading…
Reference in a new issue