mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-24 02:04:04 +08:00
Merge branch 'release_20.01' into dev
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user