mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
More replacements from open() to codecs.open(). conf.dataEncoding has to be used only for non-binary files.
This commit is contained in:
@@ -96,7 +96,7 @@ def __urllib2Opener():
|
||||
urllib2.install_opener(opener)
|
||||
|
||||
def __feedTargetsDict(reqFile, addedTargetUrls):
|
||||
fp = codecs.open(reqFile, "rb", conf.dataEncoding)
|
||||
fp = codecs.open(reqFile, "rb")
|
||||
|
||||
fread = fp.read()
|
||||
fread = fread.replace("\r", "")
|
||||
@@ -745,7 +745,7 @@ def __setHTTPUserAgent():
|
||||
logger.debug(debugMsg)
|
||||
|
||||
try:
|
||||
fd = open(conf.userAgentsFile, "r")
|
||||
fd = codecs.open(conf.userAgentsFile, "r", conf.dataEncoding)
|
||||
except IOError:
|
||||
warnMsg = "unable to read HTTP User-Agent header "
|
||||
warnMsg += "file '%s'" % conf.userAgentsFile
|
||||
|
||||
Reference in New Issue
Block a user