mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 05:01:30 +00:00
refactoring
This commit is contained in:
@@ -18,6 +18,7 @@ from lib.core.common import getUnicode
|
||||
from lib.core.data import logger
|
||||
from lib.core.settings import TIME_DEFAULT_DELAY
|
||||
from lib.core.settings import VERSION_STRING
|
||||
from lib.core.settings import UNICODE_ENCODING
|
||||
|
||||
def cmdLineParser():
|
||||
"""
|
||||
@@ -545,11 +546,12 @@ def cmdLineParser():
|
||||
parser.add_option_group(miscellaneous)
|
||||
|
||||
args = []
|
||||
from lib.core.common import dataToStdout
|
||||
for arg in sys.argv:
|
||||
try:
|
||||
args.append(getUnicode(arg, sys.stdin.encoding or sys.getfilesystemencoding()))
|
||||
args.append(getUnicode(arg, sys.getfilesystemencoding() or sys.stdin.encoding))
|
||||
except:
|
||||
args.append(getUnicode(arg, "utf8"))
|
||||
args.append(getUnicode(arg, UNICODE_ENCODING))
|
||||
(args, _) = parser.parse_args(args)
|
||||
|
||||
if not args.direct and not args.url and not args.list and not args.googleDork and not args.configFile\
|
||||
|
||||
@@ -13,10 +13,10 @@ from ConfigParser import NoSectionError
|
||||
|
||||
from lib.core.common import checkFile
|
||||
from lib.core.common import UnicodeRawConfigParser
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import sqlmapMissingMandatoryOptionException
|
||||
from lib.core.optiondict import optDict
|
||||
from lib.core.settings import UNICODE_ENCODING
|
||||
|
||||
config = None
|
||||
|
||||
@@ -58,7 +58,7 @@ def configFileParser(configFile):
|
||||
logger.debug(debugMsg)
|
||||
|
||||
checkFile(configFile)
|
||||
configFP = codecs.open(configFile, "rb", conf.dataEncoding)
|
||||
configFP = codecs.open(configFile, "rb", UNICODE_ENCODING)
|
||||
config = UnicodeRawConfigParser()
|
||||
config.readfp(configFP)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user