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

Skip to content

Commit c470255

Browse files
committed
minor update
1 parent 12a5ec9 commit c470255

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

lib/core/xmldump.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env python
22

3-
43
import codecs
54
import re
65

@@ -62,7 +61,6 @@
6261
TYPE_ATTR = "type"
6362
VALUE_ATTR = "value"
6463
SUCESS_ATTR = "success"
65-
ENCODING = "utf-8"
6664
NAME_SPACE_ATTR = 'http://www.w3.org/2001/XMLSchema-instance'
6765
XMLNS_ATTR = "xmlns:xsi"
6866
SCHEME_NAME = "sqlmap.xsd"
@@ -480,7 +478,7 @@ def setOutputFile(self):
480478
if (conf.xmlFile) :
481479
try :
482480
self.__outputFile = conf.xmlFile
483-
self.__outputFP = codecs.open(self.__outputFile, "ab", conf.dataEncoding)
481+
self.__outputFP = codecs.open(self.__outputFile, "a", conf.dataEncoding)
484482
self.__root = self.__doc.createElementNS(NAME_SPACE_ATTR, RESULTS_ELEM_NAME)
485483
self.__root.setAttributeNode(self.__createAttribute(XMLNS_ATTR,NAME_SPACE_ATTR))
486484
self.__root.setAttributeNode(self.__createAttribute(SCHEME_NAME_ATTR,SCHEME_NAME))
@@ -511,7 +509,7 @@ def finish(self, resultStatus, resultMsg=""):
511509
statusElem.appendChild(errorElem)
512510

513511
self.__addToRoot(statusElem)
514-
self.__write(self.__doc.toprettyxml(encoding=ENCODING))
512+
self.__write(self.__doc.toprettyxml(encoding=conf.dataEncoding))
515513
self.__outputFP.close()
516514

517515
def closeDumper(status, msg=""):

0 commit comments

Comments
 (0)