From 79d0c83f8f6d2db559258d0ad6d93ebc3a3e7ce9 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 20 May 2019 12:09:14 +0200 Subject: [PATCH] Bug fix for Python3 (drei lack of color output) --- lib/core/settings.py | 2 +- thirdparty/ansistrm/ansistrm.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index ee1dde43e..b01e30c70 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.3.5.113" +VERSION = "1.3.5.114" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) diff --git a/thirdparty/ansistrm/ansistrm.py b/thirdparty/ansistrm/ansistrm.py index ecb478fd6..55c55f7b7 100644 --- a/thirdparty/ansistrm/ansistrm.py +++ b/thirdparty/ansistrm/ansistrm.py @@ -94,7 +94,6 @@ class ColorizingStreamHandler(logging.StreamHandler): def output_colorized(self, message): parts = self.ansi_esc.split(message) - write = self.stream.write h = None fd = getattr(self.stream, 'fileno', None) @@ -108,7 +107,8 @@ class ColorizingStreamHandler(logging.StreamHandler): text = parts.pop(0) if text: - write(text) + self.stream.write(text) + self.stream.flush() if parts: params = parts.pop(0)