File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2855,16 +2855,15 @@ def createGithubIssue(errMsg, excMsg):
28552855 msg = "\n do you want to automatically create a new (anonymized) issue "
28562856 msg += "with the unhandled exception information at "
28572857 msg += "the official Github repository? [y/N] "
2858- test = readInput (msg , default = "N" )
2859- if test [0 ] in ("y" , "Y" ):
2858+ try :
2859+ test = readInput (msg , default = "N" )
2860+ except :
2861+ test = None
2862+
2863+ if test and test [0 ] in ("y" , "Y" ):
28602864 ex = None
28612865 errMsg = errMsg [errMsg .find ("\n " ):]
28622866
2863- for match in re .finditer (r'File "(.+?)", line' , excMsg ):
2864- file = match .group (1 ).replace ('\\ ' , "/" )
2865- file = file [file .find ("sqlmap" ):].replace ("sqlmap/" , "" , 1 )
2866- excMsg = excMsg .replace (match .group (1 ), file )
2867-
28682867 data = {"title" : "Unhandled exception (#%s)" % hashlib .md5 (excMsg ).hexdigest ()[:8 ], "body" : "```%s\n ```\n ```\n %s```" % (errMsg , excMsg )}
28692868 req = urllib2 .Request (url = "https://api.github.com/repos/sqlmapproject/sqlmap/issues" , data = json .dumps (data ), headers = {"Authorization" : "token %s" % GITHUB_REPORT_OAUTH_TOKEN })
28702869
Original file line number Diff line number Diff line change 99import inspect
1010import logging
1111import os
12+ import re
1213import sys
1314import time
1415import traceback
@@ -129,6 +130,12 @@ def main():
129130 print
130131 errMsg = unhandledExceptionMessage ()
131132 excMsg = traceback .format_exc ()
133+
134+ for match in re .finditer (r'File "(.+?)", line' , excMsg ):
135+ file = match .group (1 ).replace ('\\ ' , "/" )
136+ file = file [file .find ("sqlmap" ):].replace ("sqlmap/" , "" , 1 )
137+ excMsg = excMsg .replace (match .group (1 ), file )
138+
132139 logger .critical (errMsg )
133140 kb .stickyLevel = logging .CRITICAL
134141 dataToStdout (excMsg )
You can’t perform that action at this time.
0 commit comments