From a0dca74c1248406a40af65fedfd8f4bff9b49d1c Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 19 Nov 2019 12:21:39 +0100 Subject: [PATCH] Minor patch --- lib/core/common.py | 4 +++- lib/core/settings.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index d978a5a7e..c727a8d0f 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -3580,6 +3580,8 @@ def openFile(filename, mode='r', encoding=UNICODE_ENCODING, errors="reversible", >>> "openFile" in openFile(__file__).read() True + >>> b"openFile" in openFile(__file__, "rb", None).read() + True """ if filename == STDIN_PIPE_DASH: @@ -3589,7 +3591,7 @@ def openFile(filename, mode='r', encoding=UNICODE_ENCODING, errors="reversible", return contextlib.closing(io.StringIO(readCachedFileContent(filename))) else: try: - return codecs.open(filename, mode, encoding, errors, buffering) + return codecs.open(filename, mode, encoding, errors, buffering and 'b' not in mode) except IOError: errMsg = "there has been a file opening error for filename '%s'. " % filename errMsg += "Please check %s permissions on a file " % ("write" if mode and ('w' in mode or 'a' in mode or '+' in mode) else "read") diff --git a/lib/core/settings.py b/lib/core/settings.py index c0d6a759b..ca8a1561e 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.3.11.81" +VERSION = "1.3.11.82" 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)