diff --git a/lib/core/common.py b/lib/core/common.py index c727a8d0f..0178657d0 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -3584,6 +3584,10 @@ def openFile(filename, mode='r', encoding=UNICODE_ENCODING, errors="reversible", True """ + # Reference: https://stackoverflow.com/a/37462452 + if 'b' in mode: + buffering = 0 + if filename == STDIN_PIPE_DASH: if filename not in kb.cache.content: kb.cache.content[filename] = sys.stdin.read() @@ -3591,7 +3595,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 and 'b' not in mode) + return codecs.open(filename, mode, encoding, errors, buffering) 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 ca8a1561e..b94679487 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.82" +VERSION = "1.3.11.83" 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/sqlmap.py b/sqlmap.py index e232d4fb8..caf522f53 100755 --- a/sqlmap.py +++ b/sqlmap.py @@ -35,6 +35,7 @@ try: warnings.filterwarnings(action="ignore", message=".*was already imported", category=UserWarning) warnings.filterwarnings(action="ignore", message=".*using a very old release", category=UserWarning) + warnings.filterwarnings(action="ignore", message=".*default buffer size will be used", category=RuntimeWarning) warnings.filterwarnings(action="ignore", category=DeprecationWarning) from lib.core.data import logger