@@ -1213,9 +1213,9 @@ def randomStr(length=4, lowercase=False, alphabet=None, seed=None):
12131213 """
12141214
12151215 if seed is not None :
1216- _ = getCurrentThreadData ().random
1217- _ .seed (seed )
1218- choice = _ .choice
1216+ _random = getCurrentThreadData ().random
1217+ _random .seed (seed )
1218+ choice = _random .choice
12191219 else :
12201220 choice = random .choice
12211221
@@ -1247,10 +1247,12 @@ def getHeader(headers, key):
12471247 """
12481248
12491249 retVal = None
1250- for _ in (headers or {}):
1251- if _ .upper () == key .upper ():
1252- retVal = headers [_ ]
1250+
1251+ for header in (headers or {}):
1252+ if header .upper () == key .upper ():
1253+ retVal = headers [header ]
12531254 break
1255+
12541256 return retVal
12551257
12561258def checkPipedInput ():
@@ -1431,6 +1433,7 @@ def setPaths(rootPath):
14311433 checkFile (path )
14321434
14331435 if IS_WIN :
1436+ # Reference: https://pureinfotech.com/list-environment-variables-windows-10/
14341437 if os .getenv ("LOCALAPPDATA" ):
14351438 paths .SQLMAP_HOME_PATH = os .path .expandvars ("%LOCALAPPDATA%\\ sqlmap" )
14361439 elif os .getenv ("USERPROFILE" ):
@@ -1444,7 +1447,7 @@ def setPaths(rootPath):
14441447 paths .SQLMAP_DUMP_PATH = os .path .join (paths .SQLMAP_OUTPUT_PATH , "%s" , "dump" )
14451448 paths .SQLMAP_FILES_PATH = os .path .join (paths .SQLMAP_OUTPUT_PATH , "%s" , "files" )
14461449
1447- # history files
1450+ # History files
14481451 paths .SQLMAP_HISTORY_PATH = getUnicode (os .path .join (paths .SQLMAP_HOME_PATH , "history" ), encoding = sys .getfilesystemencoding () or UNICODE_ENCODING )
14491452 paths .API_SHELL_HISTORY = os .path .join (paths .SQLMAP_HISTORY_PATH , "api.hst" )
14501453 paths .OS_SHELL_HISTORY = os .path .join (paths .SQLMAP_HISTORY_PATH , "os.hst" )
@@ -1601,7 +1604,7 @@ def parseTargetUrl():
16011604 originalUrl = conf .url
16021605
16031606 if re .search (r"\[.+\]" , conf .url ) and not socket .has_ipv6 :
1604- errMsg = "IPv6 addressing is not supported "
1607+ errMsg = "IPv6 communication is not supported "
16051608 errMsg += "on this platform"
16061609 raise SqlmapGenericException (errMsg )
16071610
@@ -1658,7 +1661,7 @@ def parseTargetUrl():
16581661 conf .port = 80
16591662
16601663 if conf .port < 1 or conf .port > 65535 :
1661- errMsg = "invalid target URL's port (%d)" % conf .port
1664+ errMsg = "invalid target URL port (%d)" % conf .port
16621665 raise SqlmapSyntaxException (errMsg )
16631666
16641667 conf .url = getUnicode ("%s://%s:%d%s" % (conf .scheme , ("[%s]" % conf .hostname ) if conf .ipv6 else conf .hostname , conf .port , conf .path ))
0 commit comments