Merge branch 'release_20.01' into dev

This commit is contained in:
Nicola Soranzo
2020-02-12 01:32:24 +00:00
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ lint_tool_types = ["*"]
def lint_general(tool_source, lint_ctx):
"""Check tool version, name, and id."""
version = tool_source.parse_version()
version = tool_source.parse_version() or ''
parsed_version = packaging.version.parse(version)
if not version:
lint_ctx.error(ERROR_VERSION_MSG)
+6 -2
View File
@@ -1,6 +1,7 @@
"""Utilities for loading and reasoning about unparsed tools in directories."""
import fnmatch
import glob
import io
import logging
import os
import re
@@ -170,8 +171,11 @@ def looks_like_xml(path, regex=TOOL_REGEX):
checkers.is_zip(full_path)):
return False
with open(path, "r") as f:
start_contents = f.read(5 * 1024)
with io.open(path, "r", encoding='utf-8') as f:
try:
start_contents = f.read(5 * 1024)
except UnicodeDecodeError:
return False
if regex.search(start_contents):
return True