Skip to content

Commit 27519ca

Browse files
committed
handle UnicodeDecodeError in cwls
1 parent 9aa34a0 commit 27519ca

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

latex_cwl_completions.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import os
88
import re
99
import threading
10+
from sys import exc_info
1011

1112
if sublime.version() < '3000':
1213
# we are on ST2 and Python 2.X
@@ -423,6 +424,13 @@ def cwl_parsing_handler(callback):
423424
)
424425
)
425426
continue
427+
except UnicodeDecodeError:
428+
print(
429+
u'{0}: {1}'.format(
430+
cwl_file, exc_info()[1]
431+
)
432+
)
433+
continue
426434
else:
427435
if not os.path.isabs(cwl_file) and cwl_file.startswith('Package'):
428436
cwl_file = os.path.normpath(
@@ -438,6 +446,13 @@ def cwl_parsing_handler(callback):
438446
)
439447
)
440448
continue
449+
except UnicodeDecodeError:
450+
print(
451+
u'{0}: {1}'.format(
452+
cwl_file, exc_info()[1]
453+
)
454+
)
455+
continue
441456

442457
completions = parse_cwl_file(base_name, s)
443458
completion_results[base_name] = completions

0 commit comments

Comments
 (0)