mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 16:24:25 +03:00
minor bug fix to verify test case file exists before it gets read
This commit is contained in:
parent
1923ef691e
commit
ab607bd378
|
@ -87,18 +87,23 @@ def main():
|
||||||
|
|
||||||
test_counts.append(test_count)
|
test_counts.append(test_count)
|
||||||
|
|
||||||
console_output_fd = codecs.open(os.path.join(output_folder, "console_output"), "rb", "utf8")
|
console_output_file = os.path.join(output_folder, "console_output")
|
||||||
console_output = console_output_fd.read()
|
log_file = os.path.join(output_folder, "debiandev", "log")
|
||||||
console_output_fd.close()
|
traceback_file = os.path.join(output_folder, "traceback")
|
||||||
|
|
||||||
attachments[test_count] = str(console_output)
|
if os.path.exists(console_output_file):
|
||||||
|
console_output_fd = codecs.open(console_output_file, "rb", "utf8")
|
||||||
|
console_output = console_output_fd.read()
|
||||||
|
console_output_fd.close()
|
||||||
|
attachments[test_count] = str(console_output)
|
||||||
|
|
||||||
log_fd = codecs.open(os.path.join(output_folder, "debiandev", "log"), "rb", "utf8")
|
if os.path.exists(log_file):
|
||||||
log = log_fd.read()
|
log_fd = codecs.open(log_file, "rb", "utf8")
|
||||||
log_fd.close()
|
log = log_fd.read()
|
||||||
|
log_fd.close()
|
||||||
|
|
||||||
if traceback:
|
if os.path.exists(traceback_file):
|
||||||
traceback_fd = codecs.open(os.path.join(output_folder, "traceback"), "rb", "utf8")
|
traceback_fd = codecs.open(traceback_file, "rb", "utf8")
|
||||||
traceback = traceback_fd.read()
|
traceback = traceback_fd.read()
|
||||||
traceback_fd.close()
|
traceback_fd.close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user