Thu, 14 Jan 2021 18:01:59 +0100
Third Party packages
- updated editorconfig to 0.12.3
--- a/docs/changelog Thu Jan 14 17:58:40 2021 +0100 +++ b/docs/changelog Thu Jan 14 18:01:59 2021 +0100 @@ -34,6 +34,7 @@ -- updated eradicate.py to 2.0.0 -- updated chardet to 4.0.0 -- updated coverage.py to 5.3.1 + -- updated editorconfig to 0.12.3 Version 21.1: - bug fixes
--- a/eric6.e4p Thu Jan 14 17:58:40 2021 +0100 +++ b/eric6.e4p Thu Jan 14 18:01:59 2021 +0100 @@ -971,12 +971,13 @@ <Source>eric6/ThirdParty/CharDet/chardet/version.py</Source> <Source>eric6/ThirdParty/EditorConfig/__init__.py</Source> <Source>eric6/ThirdParty/EditorConfig/editorconfig/__init__.py</Source> + <Source>eric6/ThirdParty/EditorConfig/editorconfig/__main__.py</Source> <Source>eric6/ThirdParty/EditorConfig/editorconfig/compat.py</Source> <Source>eric6/ThirdParty/EditorConfig/editorconfig/exceptions.py</Source> <Source>eric6/ThirdParty/EditorConfig/editorconfig/fnmatch.py</Source> <Source>eric6/ThirdParty/EditorConfig/editorconfig/handler.py</Source> <Source>eric6/ThirdParty/EditorConfig/editorconfig/ini.py</Source> - <Source>eric6/ThirdParty/EditorConfig/editorconfig/main.py</Source> + <Source>eric6/ThirdParty/EditorConfig/editorconfig/version.py</Source> <Source>eric6/ThirdParty/EditorConfig/editorconfig/versiontools.py</Source> <Source>eric6/ThirdParty/Jasy/__init__.py</Source> <Source>eric6/ThirdParty/Jasy/jasy/__init__.py</Source>
--- a/eric6/ThirdParty/EditorConfig/COPYING Thu Jan 14 17:58:40 2021 +0100 +++ b/eric6/ThirdParty/EditorConfig/COPYING Thu Jan 14 18:01:59 2021 +0100 @@ -1,4 +1,4 @@ -Copyright 2011-2018 EditorConfig Team, including Hong Xu and Trey Hunner +Copyright (c) 2011-2018 EditorConfig Team, including Hong Xu and Trey Hunner editorconfig-core-py is free software. You are free to copy, modify, and/or redistribute this work under the terms of the BSD
--- a/eric6/ThirdParty/EditorConfig/LICENSE.BSD Thu Jan 14 17:58:40 2021 +0100 +++ b/eric6/ThirdParty/EditorConfig/LICENSE.BSD Thu Jan 14 18:01:59 2021 +0100 @@ -1,4 +1,4 @@ -Copyright 2011-2018 EditorConfig Team, including Hong Xu and Trey Hunner +Copyright (c) 2011-2018 EditorConfig Team, including Hong Xu and Trey Hunner Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
--- a/eric6/ThirdParty/EditorConfig/editorconfig/__init__.py Thu Jan 14 17:58:40 2021 +0100 +++ b/eric6/ThirdParty/EditorConfig/editorconfig/__init__.py Thu Jan 14 18:01:59 2021 +0100 @@ -1,8 +1,7 @@ """EditorConfig Python Core""" from editorconfig.versiontools import join_version - -VERSION = (0, 12, 2, "final") +from editorconfig.version import VERSION __all__ = ['get_properties', 'EditorConfigError', 'exceptions']
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/eric6/ThirdParty/EditorConfig/editorconfig/__main__.py Thu Jan 14 18:01:59 2021 +0100 @@ -0,0 +1,82 @@ +"""EditorConfig command line interface + +Licensed under Simplified BSD License (see LICENSE.BSD file). + +""" + +import getopt +import sys + +from editorconfig import VERSION, __version__ +from editorconfig.compat import force_unicode +from editorconfig.exceptions import ParsingError, PathError, VersionError +from editorconfig.handler import EditorConfigHandler +from editorconfig.versiontools import split_version + + +def version(): + print("EditorConfig Python Core Version %s" % __version__) + + +def usage(command, error=False): + if error: + out = sys.stderr + else: + out = sys.stdout + out.write("%s [OPTIONS] FILENAME\n" % command) + out.write('-f ' + 'Specify conf filename other than ".editorconfig".\n') + out.write("-b " + "Specify version (used by devs to test compatibility).\n") + out.write("-h OR --help Print this help message.\n") + out.write("-v OR --version Display version information.\n") + + +def main(): + command_name = sys.argv[0] + try: + opts, args = getopt.getopt(list(map(force_unicode, sys.argv[1:])), + "vhb:f:", ["version", "help"]) + except getopt.GetoptError as e: + print(str(e)) + usage(command_name, error=True) + sys.exit(2) + + version_tuple = VERSION + conf_filename = '.editorconfig' + + for option, arg in opts: + if option in ('-h', '--help'): + usage(command_name) + sys.exit() + if option in ('-v', '--version'): + version() + sys.exit() + if option == '-f': + conf_filename = arg + if option == '-b': + version_tuple = split_version(arg) + if version_tuple is None: + sys.exit("Invalid version number: %s" % arg) + + if len(args) < 1: + usage(command_name, error=True) + sys.exit(2) + filenames = args + multiple_files = len(args) > 1 + + for filename in filenames: + handler = EditorConfigHandler(filename, conf_filename, version_tuple) + try: + options = handler.get_configurations() + except (ParsingError, PathError, VersionError) as e: + print(str(e)) + sys.exit(2) + if multiple_files: + print("[%s]" % filename) + for key, value in options.items(): + print("%s=%s" % (key, value)) + + +if __name__ == "__main__": + main()
--- a/eric6/ThirdParty/EditorConfig/editorconfig/fnmatch.py Thu Jan 14 17:58:40 2021 +0100 +++ b/eric6/ThirdParty/EditorConfig/editorconfig/fnmatch.py Thu Jan 14 18:01:59 2021 +0100 @@ -28,7 +28,7 @@ LEFT_BRACE = re.compile( r""" - (?: ^ | [^\\] ) # Beginning of string or a character besides "\" + (?<! \\ ) # Not preceded by "\" \{ # "{" @@ -38,7 +38,7 @@ RIGHT_BRACE = re.compile( r""" - (?: ^ | [^\\] ) # Beginning of string or a character besides "\" + (?<! \\ ) # Not preceded by "\" \} # "}" @@ -135,7 +135,7 @@ else: result += '[^/]*' elif current_char == '?': - result += '.' + result += '[^/]' elif current_char == '[': if in_brackets: result += '\\[' @@ -148,8 +148,8 @@ break pos += 1 if has_slash: - result += '\\[' + pat[index:(pos + 1)] + '\\]' - index = pos + 2 + result += '\\[' + pat[index:(pos + 1)] + index = pos + 1 else: if index < length and pat[index] in '!^': index += 1 @@ -163,8 +163,11 @@ else: result += '\\' + current_char elif current_char == ']': - result += current_char - in_brackets = False + if in_brackets and pat[index-2] == '\\': + result += '\\]' + else: + result += current_char + in_brackets = False elif current_char == '{': pos = index has_comma = False @@ -178,7 +181,7 @@ num_range = NUMERIC_RANGE.match(pat[index:pos]) if num_range: numeric_groups.append(map(int, num_range.groups())) - result += "([+-]?\d+)" + result += r"([+-]?\d+)" else: inner_result, inner_groups = translate(pat[index:pos], nested=True) @@ -216,5 +219,5 @@ else: is_escaped = False if not nested: - result += '\Z(?ms)' + result = r'(?s)%s\Z' % result return result, numeric_groups
--- a/eric6/ThirdParty/EditorConfig/editorconfig/ini.py Thu Jan 14 17:58:40 2021 +0100 +++ b/eric6/ThirdParty/EditorConfig/editorconfig/ini.py Thu Jan 14 18:01:59 2021 +0100 @@ -27,6 +27,10 @@ __all__ = ["ParsingError", "EditorConfigParser"] +MAX_SECTION_LENGTH = 4096 +MAX_PROPERTY_LENGTH= 50 +MAX_VALUE_LENGTH = 255 + class EditorConfigParser(object): @@ -134,6 +138,8 @@ mo = self.SECTCRE.match(line) if mo: sectname = mo.group('header') + if len(sectname) > MAX_SECTION_LENGTH: + continue in_section = True matching_section = self.matches_filename(fpname, sectname) # So sections can't start with a continuation line @@ -154,6 +160,9 @@ if optval == '""': optval = '' optname = self.optionxform(optname.rstrip()) + if (len(optname) > MAX_PROPERTY_LENGTH or + len(optval) > MAX_VALUE_LENGTH): + continue if not in_section and optname == 'root': self.root_file = (optval.lower() == 'true') if matching_section:
--- a/eric6/ThirdParty/EditorConfig/editorconfig/main.py Thu Jan 14 17:58:40 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -"""EditorConfig command line interface - -Licensed under Simplified BSD License (see LICENSE.BSD file). - -""" - -import getopt -import sys - -from editorconfig import VERSION, __version__ -from editorconfig.compat import force_unicode -from editorconfig.exceptions import ParsingError, PathError, VersionError -from editorconfig.handler import EditorConfigHandler -from editorconfig.versiontools import split_version - - -def version(): - print("EditorConfig Python Core Version %s" % __version__) - - -def usage(command, error=False): - if error: - out = sys.stderr - else: - out = sys.stdout - out.write("%s [OPTIONS] FILENAME\n" % command) - out.write('-f ' - 'Specify conf filename other than ".editorconfig".\n') - out.write("-b " - "Specify version (used by devs to test compatibility).\n") - out.write("-h OR --help Print this help message.\n") - out.write("-v OR --version Display version information.\n") - - -def main(): - command_name = sys.argv[0] - try: - opts, args = getopt.getopt(list(map(force_unicode, sys.argv[1:])), - "vhb:f:", ["version", "help"]) - except getopt.GetoptError as e: - print(str(e)) - usage(command_name, error=True) - sys.exit(2) - - version_tuple = VERSION - conf_filename = '.editorconfig' - - for option, arg in opts: - if option in ('-h', '--help'): - usage(command_name) - sys.exit() - if option in ('-v', '--version'): - version() - sys.exit() - if option == '-f': - conf_filename = arg - if option == '-b': - version_tuple = split_version(arg) - if version_tuple is None: - sys.exit("Invalid version number: %s" % arg) - - if len(args) < 1: - usage(command_name, error=True) - sys.exit(2) - filenames = args - multiple_files = len(args) > 1 - - for filename in filenames: - handler = EditorConfigHandler(filename, conf_filename, version_tuple) - try: - options = handler.get_configurations() - except (ParsingError, PathError, VersionError) as e: - print(str(e)) - sys.exit(2) - if multiple_files: - print("[%s]" % filename) - for key, value in options.items(): - print("%s=%s" % (key, value))