File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -637,7 +637,14 @@ def stdoutEncode(value):
637637
638638 kb .codePage = kb .codePage or ""
639639
640- encoding = kb .get ("codePage" ) or getattr (sys .stdout , "encoding" , None ) or UNICODE_ENCODING
640+ # Python 3.6+ writes to the Windows console via WriteConsoleW (PEP 528), so sys.stdout.encoding
641+ # (typically 'utf-8') renders Unicode that the legacy OEM/ANSI code page from 'chcp' would replace
642+ # with '?'; prefer it there. The chcp-derived code page stays as the fallback (older interpreters,
643+ # PYTHONLEGACYWINDOWSSTDIO, or a console encoding Python could not determine) and for Python 2.
644+ if six .PY3 :
645+ encoding = getattr (sys .stdout , "encoding" , None ) or kb .get ("codePage" ) or UNICODE_ENCODING
646+ else :
647+ encoding = kb .get ("codePage" ) or getattr (sys .stdout , "encoding" , None ) or UNICODE_ENCODING
641648
642649 if six .PY3 :
643650 if isinstance (value , (bytes , bytearray )):
Original file line number Diff line number Diff line change 2020from thirdparty import six
2121
2222# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
23- VERSION = "1.10.7.251 "
23+ VERSION = "1.10.7.252 "
2424TYPE = "dev" if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] != '0' else "stable"
2525TYPE_COLORS = {"dev" : 33 , "stable" : 90 , "pip" : 34 }
2626VERSION_STRING = "sqlmap/%s#%s" % ('.' .join (VERSION .split ('.' )[:- 1 ]) if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] == '0' else VERSION , TYPE )
You can’t perform that action at this time.
0 commit comments