From f6792be2a87bc65bd5274b1231090d6e271ef660 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Mon, 1 Jun 2026 13:34:07 -0500 Subject: [PATCH] bug fix: decoding ... --- smart/cmd/__init__.py | 5 +++-- smart/folder/__init__.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/smart/cmd/__init__.py b/smart/cmd/__init__.py index 944abb4..25807c4 100644 --- a/smart/cmd/__init__.py +++ b/smart/cmd/__init__.py @@ -63,8 +63,9 @@ def read(**args) : elif 'cmd' in args : cmd = args['cmd'] if cmd : - handler = subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE) - stream = str(handler.communicate()[0]).replace("b'",'') + handler = subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE,encoding='utf-8') + stream = str(handler.communicate()[0]) #.decode('utf-8') #.replace("b'",'') + return _parser (stream) if _parser else stream diff --git a/smart/folder/__init__.py b/smart/folder/__init__.py index a50df84..7d6d575 100644 --- a/smart/folder/__init__.py +++ b/smart/folder/__init__.py @@ -35,7 +35,7 @@ class Util : def read(**args): """ - The path can also take in regular expressions + The path can also take in regular expressions, this only works for linux based systems. """ cmd = {"size":"du -sh :path","content":"find :path -type f -exec md5sum {} + | sort -z|md5sum"} r = {}