mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-26 11:33:47 +03:00
dealing with http://bugs.python.org/issue1602
This commit is contained in:
parent
9a9838f1e6
commit
de2479b864
|
@ -604,6 +604,21 @@ def dataToStdout(data, forceOutput=False):
|
||||||
if not ('threadException' in kb and kb.threadException):
|
if not ('threadException' in kb and kb.threadException):
|
||||||
if forceOutput or not getCurrentThreadData().disableStdOut:
|
if forceOutput or not getCurrentThreadData().disableStdOut:
|
||||||
try:
|
try:
|
||||||
|
if IS_WIN:
|
||||||
|
output = data.encode('ascii', errors="replace")
|
||||||
|
if output != data and 'dataToStdout' not in kb.warningFlags:
|
||||||
|
kb.warningFlags.add('dataToStdout')
|
||||||
|
warnMsg = "cannot properly display Unicode characters "
|
||||||
|
warnMsg += "inside Windows OS command prompt "
|
||||||
|
warnMsg += "(http://bugs.python.org/issue1602). all "
|
||||||
|
warnMsg += "similar occurances will result in "
|
||||||
|
warnMsg += "replacement with '?' character. please, find "
|
||||||
|
warnMsg += "proper character representations inside "
|
||||||
|
warnMsg += "coresponding output files. "
|
||||||
|
warnMsg += "p.s. FORMAT C: /U is highly recommended"
|
||||||
|
logger.critical(warnMsg)
|
||||||
|
sys.stdout.write(output)
|
||||||
|
else:
|
||||||
sys.stdout.write(data.encode(sys.stdout.encoding))
|
sys.stdout.write(data.encode(sys.stdout.encoding))
|
||||||
except:
|
except:
|
||||||
sys.stdout.write(data.encode(UNICODE_ENCODING))
|
sys.stdout.write(data.encode(UNICODE_ENCODING))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user