@@ -2328,22 +2328,21 @@ def initCommonOutputs():
23282328 kb .commonOutputs = {}
23292329 key = None
23302330
2331- with openFile (paths .COMMON_OUTPUTS , 'r' ) as f :
2332- for line in f :
2333- if line .find ('#' ) != - 1 :
2334- line = line [:line .find ('#' )]
2331+ for line in openFile (paths .COMMON_OUTPUTS , 'r' ):
2332+ if line .find ('#' ) != - 1 :
2333+ line = line [:line .find ('#' )]
23352334
2336- line = line .strip ()
2335+ line = line .strip ()
23372336
2338- if len (line ) > 1 :
2339- if line .startswith ('[' ) and line .endswith (']' ):
2340- key = line [1 :- 1 ]
2341- elif key :
2342- if key not in kb .commonOutputs :
2343- kb .commonOutputs [key ] = set ()
2337+ if len (line ) > 1 :
2338+ if line .startswith ('[' ) and line .endswith (']' ):
2339+ key = line [1 :- 1 ]
2340+ elif key :
2341+ if key not in kb .commonOutputs :
2342+ kb .commonOutputs [key ] = set ()
23442343
2345- if line not in kb .commonOutputs [key ]:
2346- kb .commonOutputs [key ].add (line )
2344+ if line not in kb .commonOutputs [key ]:
2345+ kb .commonOutputs [key ].add (line )
23472346
23482347def getFileItems (filename , commentPrefix = '#' , unicoded = True , lowercase = False , unique = False ):
23492348 """
@@ -3921,7 +3920,7 @@ def normalizeUnicode(value, charset=string.printable[:string.printable.find(' ')
39213920
39223921 # Reference: http://www.peterbe.com/plog/unicode-to-ascii
39233922
3924- >>> normalizeUnicode(u'\u0161 u\u0107 uraj') == u'sucuraj'
3923+ >>> normalizeUnicode(u'\\ u0161u\ \ u0107uraj') == u'sucuraj'
39253924 True
39263925 >>> normalizeUnicode(getUnicode(decodeHex("666f6f00626172"))) == u'foobar'
39273926 True
@@ -4096,7 +4095,7 @@ def __init__(self):
40964095 debugMsg = "mnemonic '%s' resolved to %s). " % (name , found )
40974096 logger .debug (debugMsg )
40984097 else :
4099- found = sorted (options .keys (), key = lambda x : len ( x ) )[0 ]
4098+ found = sorted (options .keys (), key = len )[0 ]
41004099 warnMsg = "detected ambiguity (mnemonic '%s' can be resolved to any of: %s). " % (name , ", " .join ("'%s'" % key for key in options ))
41014100 warnMsg += "Resolved to shortest of those ('%s')" % found
41024101 logger .warn (warnMsg )
@@ -5043,7 +5042,6 @@ def _parseBurpLog(content):
50435042def getSafeExString (ex , encoding = None ):
50445043 """
50455044 Safe way how to get the proper exception represtation as a string
5046- (Note: errors to be avoided: 1) "%s" % Exception(u'\u0161 ') and 2) "%s" % str(Exception(u'\u0161 '))
50475045
50485046 >>> getSafeExString(SqlmapBaseException('foobar')) == 'foobar'
50495047 True
0 commit comments