Skip to content

Commit

Permalink
fix: windows log color issue
Browse files Browse the repository at this point in the history
  • Loading branch information
13ph03nix committed Jan 20, 2022
1 parent f96ed12 commit b5b11dc
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,7 @@ Cross-platform shell code generation
* fix #254
* fix urlparse fails with simple url
* use pycryptodomex instead of pycryptodome, fix #255

# version 1.8.11
-----------------
* fix windows log color issue #258
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ It comes with a powerful proof-of-concept engine, many nice features for the ult

## Requirements

- Python 3.6+
- Python 3.7+
- Works on Linux, Windows, Mac OSX, BSD, etc.

## Installation
Expand Down
2 changes: 1 addition & 1 deletion pocsuite3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__title__ = 'pocsuite3'
__version__ = '1.8.10'
__version__ = '1.8.11'
__author__ = 'Knownsec 404 Team'
__author_email__ = '[email protected]'
__license__ = 'GPLv2'
Expand Down
8 changes: 7 additions & 1 deletion pocsuite3/lib/core/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
logging.addLevelName(CUSTOM_LOGGING.WARNING, "!")

LOGGER = logging.getLogger("pocsuite")
sys.stdout = open(sys.stdout.fileno(), mode='w', encoding='utf8', buffering=1)
try:
# for python>=3.7
sys.stdout.reconfigure(encoding='utf-8')
except AttributeError:
# https://www.macfreek.nl/memory/Encoding_of_Python_stdout
import codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout.buffer, 'strict')
LOGGER_HANDLER = logging.StreamHandler(sys.stdout)
PRIMARY_FMT = (
"%(cyan)s[%(asctime)s] %(log_color)s[%(levelname)s]%(reset)s %(message)s"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def find_packages(where='.'):

setup(
name='pocsuite3',
version='1.8.10',
version='1.8.11',
url='https://pocsuite.org',
description='Open-sourced remote vulnerability testing framework.',
long_description=long_description,
Expand Down

0 comments on commit b5b11dc

Please sign in to comment.