Procházet zdrojové kódy

bug fix: decoding ...

Steve Nyemba před 1 měsícem
rodič
revize
f6792be2a8
2 změnil soubory, kde provedl 4 přidání a 3 odebrání
  1. 3 2
      smart/cmd/__init__.py
  2. 1 1
      smart/folder/__init__.py

+ 3 - 2
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
 

+ 1 - 1
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 = {}