From 0bbd7fdcadb65f49854920045af447f8872f009e Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 8 May 2019 14:53:08 +0200 Subject: [PATCH] Minor update (drei DeprecationWarnings) --- lib/core/settings.py | 2 +- thirdparty/beautifulsoup/beautifulsoup.py | 16 +++++++--------- thirdparty/colorama/ansitowin32.py | 4 ++-- thirdparty/gprof2dot/gprof2dot.py | 10 ++++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index eea36929a..730279525 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -VERSION = "1.3.5.54" +VERSION = "1.3.5.55" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) diff --git a/thirdparty/beautifulsoup/beautifulsoup.py b/thirdparty/beautifulsoup/beautifulsoup.py index 4d7e86be3..a4e6e7fc8 100644 --- a/thirdparty/beautifulsoup/beautifulsoup.py +++ b/thirdparty/beautifulsoup/beautifulsoup.py @@ -449,9 +449,7 @@ class PageElement(object): s = self.toEncoding(str(s), encoding or "utf8") return s - BARE_AMPERSAND_OR_BRACKET = re.compile("([<>]|" - + "&(?!#\d+;|#x[0-9a-fA-F]+;|\w+;)" - + ")") + BARE_AMPERSAND_OR_BRACKET = re.compile(r"([<>]|&(?!#\d+;|#x[0-9a-fA-F]+;|\w+;))") def _sub_entity(self, x): """Used with a regular expression to substitute the @@ -574,7 +572,7 @@ class Tag(PageElement): # Convert any HTML, XML, or numeric entities in the attribute values. # Reference: https://github.com/pkrumins/xgoogle/pull/16/commits/3dba1165c436b0d6e5bdbd09e53ca0dbf8a043f8 convert = lambda k_val: (k_val[0], - re.sub("&(#\d+|#x[0-9a-fA-F]+|\w+);", + re.sub(r"&(#\d+|#x[0-9a-fA-F]+|\w+);", self._convertEntities, k_val[1])) self.attrs = map(convert, self.attrs) @@ -1079,9 +1077,9 @@ class BeautifulStoneSoup(Tag, sgmllib.SGMLParser): QUOTE_TAGS = {} PRESERVE_WHITESPACE_TAGS = [] - MARKUP_MASSAGE = [(re.compile('(<[^<>]*)/>'), + MARKUP_MASSAGE = [(re.compile(r'(<[^<>]*)/>'), lambda x: x.group(1) + ' />'), - (re.compile(']*)>'), + (re.compile(r']*)>'), lambda x: '') ] @@ -1590,7 +1588,7 @@ class BeautifulSoup(BeautifulStoneSoup): NESTABLE_LIST_TAGS, NESTABLE_TABLE_TAGS) # Used to detect the charset in a META tag; see start_meta - CHARSET_RE = re.compile("((^|;)\s*charset=)([^;]*)", re.M) + CHARSET_RE = re.compile(r"((^|;)\s*charset=)([^;]*)", re.M) def start_meta(self, attrs): """Beautiful Soup can detect a charset included in a META tag, @@ -1934,9 +1932,9 @@ class UnicodeDammit: except: xml_encoding_match = None xml_encoding_match = re.compile( - '^<\?.*encoding=[\'"](.*?)[\'"].*\?>').match(xml_data) + r'^<\?.*encoding=[\'"](.*?)[\'"].*\?>').match(xml_data) if not xml_encoding_match and isHTML: - regexp = re.compile('<\s*meta[^>]+charset=([^>]*?)[;\'">]', re.I) + regexp = re.compile(r'<\s*meta[^>]+charset=([^>]*?)[;\'">]', re.I) xml_encoding_match = regexp.search(xml_data) if xml_encoding_match is not None: xml_encoding = xml_encoding_match.groups()[0].lower() diff --git a/thirdparty/colorama/ansitowin32.py b/thirdparty/colorama/ansitowin32.py index 2c9cea763..c8c721a13 100644 --- a/thirdparty/colorama/ansitowin32.py +++ b/thirdparty/colorama/ansitowin32.py @@ -46,8 +46,8 @@ class AnsiToWin32(object): sequences from the text, and if outputting to a tty, will convert them into win32 function calls. ''' - ANSI_CSI_RE = re.compile('\001?\033\[((?:\d|;)*)([a-zA-Z])\002?') # Control Sequence Introducer - ANSI_OSC_RE = re.compile('\001?\033\]((?:.|;)*?)(\x07)\002?') # Operating System Command + ANSI_CSI_RE = re.compile('\001?\033\\[((?:\\d|;)*)([a-zA-Z])\002?') # Control Sequence Introducer + ANSI_OSC_RE = re.compile('\001?\033\\]((?:.|;)*?)(\x07)\002?') # Operating System Command def __init__(self, wrapped, convert=None, strip=None, autoreset=False): # The wrapped stream (normally sys.stdout or sys.stderr) diff --git a/thirdparty/gprof2dot/gprof2dot.py b/thirdparty/gprof2dot/gprof2dot.py index 64bf5e39b..8fd8797af 100644 --- a/thirdparty/gprof2dot/gprof2dot.py +++ b/thirdparty/gprof2dot/gprof2dot.py @@ -1042,7 +1042,7 @@ class CallgrindParser(LineParser): - http://valgrind.org/docs/manual/cl-Format.html """ - _call_re = re.compile('^calls=\s*(\d+)\s+((\d+|\+\d+|-\d+|\*)\s+)+$') + _call_re = re.compile(r'^calls=\s*(\d+)\s+((\d+|\+\d+|-\d+|\*)\s+)+$') def __init__(self, infile): LineParser.__init__(self, infile) @@ -1204,7 +1204,7 @@ class CallgrindParser(LineParser): return True - _position_re = re.compile('^(?Pc?(?:ob|fl|fi|fe|fn))=\s*(?:\((?P\d+)\))?(?:\s*(?P.+))?') + _position_re = re.compile(r'^(?Pc?(?:ob|fl|fi|fe|fn))=\s*(?:\((?P\d+)\))?(?:\s*(?P.+))?') _position_table_map = { 'ob': 'ob', @@ -2071,7 +2071,8 @@ class PstatsParser: self.profile = Profile() self.function_ids = {} - def get_function_name(self, (filename, line, name)): + def get_function_name(self, args): + filename, line, name = args module = os.path.splitext(filename)[0] module = os.path.basename(module) return "%s:%d:%s" % (module, line, name) @@ -2406,7 +2407,8 @@ class DotWriter: raise TypeError self.write(s) - def color(self, (r, g, b)): + def color(self, args): + r, g, b = args def float2int(f): if f <= 0.0: