From 9845b53c998f0264c0c1422ef638398f4e465e49 Mon Sep 17 00:00:00 2001 From: Iman Karimi Date: Thu, 11 Nov 2021 11:34:57 +0330 Subject: [PATCH] debug subprocess for python 3.6 --- log_reader/utils.py | 5 +++-- setup.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/log_reader/utils.py b/log_reader/utils.py index 350549f..7b4213d 100644 --- a/log_reader/utils.py +++ b/log_reader/utils.py @@ -3,6 +3,7 @@ import os # import re import subprocess +from subprocess import PIPE from fnmatch import fnmatch from django.utils.translation import ugettext_lazy as _ @@ -26,8 +27,8 @@ def read_file_lines(file_name): file_path = '%s/%s' % (settings.LOG_READER_DIR_PATH, file_name) result = subprocess.run( ['tail', '-%s' % settings.LOG_READER_MAX_READ_LINES, file_path], - capture_output=True, - # text=True, + stdout=PIPE, + stderr=PIPE, encoding="utf8", ) content = repr(result.stdout) if result.stdout else None diff --git a/setup.py b/setup.py index 2f24ede..8a6e59d 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name='django-log-reader', - version='1.1.4', + version='1.1.5', zip_safe=False, packages=find_packages(), include_package_data=True,