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

Skip to content

Commit 7a5538a

Browse files
committed
Minor just in case patch
1 parent 125de09 commit 7a5538a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/core/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ def readInput(message, default=None, checkBatch=True, boolean=False):
11211121
if not retVal: # Note: Python doesn't print newline on empty input
11221122
dataToStdout("\n")
11231123
retVal = retVal.strip() or default
1124-
retVal = getUnicode(retVal, encoding=sys.stdin.encoding) if retVal else retVal
1124+
retVal = getUnicode(retVal, encoding=getattr(sys.stdin, "encoding", None)) if retVal else retVal
11251125
except:
11261126
try:
11271127
time.sleep(0.05) # Reference: http://www.gossamer-threads.com/lists/python/python/781893
@@ -3716,7 +3716,7 @@ def unhandledExceptionMessage():
37163716
errMsg += "Running version: %s\n" % VERSION_STRING[VERSION_STRING.find('/') + 1:]
37173717
errMsg += "Python version: %s\n" % PYVERSION
37183718
errMsg += "Operating system: %s\n" % platform.platform()
3719-
errMsg += "Command line: %s\n" % re.sub(r".+?\bsqlmap\.py\b", "sqlmap.py", getUnicode(" ".join(sys.argv), encoding=sys.stdin.encoding))
3719+
errMsg += "Command line: %s\n" % re.sub(r".+?\bsqlmap\.py\b", "sqlmap.py", getUnicode(" ".join(sys.argv), encoding=getattr(sys.stdin, "encoding", None)))
37203720
errMsg += "Technique: %s\n" % (enumValueToNameLookup(PAYLOAD.TECHNIQUE, getTechnique()) if getTechnique() is not None else ("DIRECT" if conf.get("direct") else None))
37213721
errMsg += "Back-end DBMS:"
37223722

0 commit comments

Comments
 (0)