@@ -72,7 +72,7 @@ def run_command(self, cmd, suppress_message=False, return_output=False):
72
72
if len (output ) == 0 and proc .poll () is not None :
73
73
break
74
74
if output :
75
- decoded_output = output .decode ("utf-8" ).strip ()
75
+ decoded_output = output .decode ("utf-8" , errors = "ignore" ).strip ()
76
76
if not suppress_message :
77
77
self .info (decoded_output )
78
78
full_output += decoded_output
@@ -84,7 +84,7 @@ def run_command(self, cmd, suppress_message=False, return_output=False):
84
84
85
85
err = proc .stderr .read ()
86
86
if not suppress_message :
87
- self .error (err .decode ("utf-8" ))
87
+ self .error (err .decode ("utf-8" , errors = "ignore" ))
88
88
if return_output :
89
89
return full_output
90
90
return False
@@ -341,6 +341,18 @@ def move(self, source, destination):
341
341
if os .path .exists (source ):
342
342
shutil .move (source , destination )
343
343
344
+ def copy (self , source , destination ):
345
+ """
346
+ Move a file or directory from source to destination
347
+ """
348
+ source = self .path (source )
349
+ destination = self .path (destination )
350
+ if os .path .exists (source ):
351
+ if os .path .isdir (source ):
352
+ shutil .copytree (source , destination )
353
+ else :
354
+ shutil .copyfile (source , destination )
355
+
344
356
def remove (self , location ):
345
357
"""
346
358
Remove a file or directory if it exists
0 commit comments