mirror of
https://github.com/explosion/spaCy.git
synced 2025-05-02 14:53:41 +03:00
print details on error msg (e.g. PermissionError on specific file)
This commit is contained in:
parent
894b8e7ff6
commit
ff233d5743
|
@ -132,7 +132,7 @@ class Warnings(object):
|
||||||
"are currently: da, de, el, en, id, lb, pt, ru, sr, ta, th.")
|
"are currently: da, de, el, en, id, lb, pt, ru, sr, ta, th.")
|
||||||
|
|
||||||
# TODO: fix numbering after merging develop into master
|
# TODO: fix numbering after merging develop into master
|
||||||
W091 = ("Could not clean/remove the temp directory at {dir}.")
|
W091 = ("Could not clean/remove the temp directory at {dir}: {msg}.")
|
||||||
W092 = ("Ignoring annotations for sentence starts, as dependency heads are set.")
|
W092 = ("Ignoring annotations for sentence starts, as dependency heads are set.")
|
||||||
W093 = ("Could not find any data to train the {name} on. Is your "
|
W093 = ("Could not find any data to train the {name} on. Is your "
|
||||||
"input data correctly formatted ?")
|
"input data correctly formatted ?")
|
||||||
|
|
|
@ -469,8 +469,8 @@ def make_tempdir():
|
||||||
yield d
|
yield d
|
||||||
try:
|
try:
|
||||||
shutil.rmtree(str(d))
|
shutil.rmtree(str(d))
|
||||||
except PermissionError:
|
except PermissionError as e:
|
||||||
warnings.warn(Warnings.W091.format(dir=d))
|
warnings.warn(Warnings.W091.format(dir=d, msg=e))
|
||||||
|
|
||||||
|
|
||||||
def get_hash(data) -> str:
|
def get_hash(data) -> str:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user