Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7bbeb9e

Browse files
committed
Dealing with Python3.8 RuntimeWarning
1 parent a0dca74 commit 7bbeb9e

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

lib/core/common.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3584,14 +3584,18 @@ def openFile(filename, mode='r', encoding=UNICODE_ENCODING, errors="reversible",
35843584
True
35853585
"""
35863586

3587+
# Reference: https://stackoverflow.com/a/37462452
3588+
if 'b' in mode:
3589+
buffering = 0
3590+
35873591
if filename == STDIN_PIPE_DASH:
35883592
if filename not in kb.cache.content:
35893593
kb.cache.content[filename] = sys.stdin.read()
35903594

35913595
return contextlib.closing(io.StringIO(readCachedFileContent(filename)))
35923596
else:
35933597
try:
3594-
return codecs.open(filename, mode, encoding, errors, buffering and 'b' not in mode)
3598+
return codecs.open(filename, mode, encoding, errors, buffering)
35953599
except IOError:
35963600
errMsg = "there has been a file opening error for filename '%s'. " % filename
35973601
errMsg += "Please check %s permissions on a file " % ("write" if mode and ('w' in mode or 'a' in mode or '+' in mode) else "read")

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.11.82"
21+
VERSION = "1.3.11.83"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

sqlmap.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
warnings.filterwarnings(action="ignore", message=".*was already imported", category=UserWarning)
3737
warnings.filterwarnings(action="ignore", message=".*using a very old release", category=UserWarning)
38+
warnings.filterwarnings(action="ignore", message=".*default buffer size will be used", category=RuntimeWarning)
3839
warnings.filterwarnings(action="ignore", category=DeprecationWarning)
3940

4041
from lib.core.data import logger

0 commit comments

Comments
 (0)