@@ -347,7 +347,7 @@ def read_binary(self, filename, start_pos):
347
347
assert type (start_pos )== int # noqa: E721
348
348
assert start_pos >= 0
349
349
350
- cmd = "tail -c +{} {} " .format (start_pos + 1 , __class__ . _escape_path ( filename ))
350
+ cmd = [ "tail" , "-c" , " +{}" .format (start_pos + 1 ), filename ]
351
351
r = self .exec_command (cmd )
352
352
assert type (r )== bytes # noqa: E721
353
353
return r
@@ -367,7 +367,7 @@ def get_file_size(self, filename):
367
367
368
368
assert filename is not None
369
369
assert type (filename )== str # noqa: E721
370
- cmd = "du -b " + __class__ . _escape_path ( filename )
370
+ cmd = [ "du" , "-b" , filename ]
371
371
372
372
s = self .exec_command (cmd ,encoding = get_default_encoding ())
373
373
assert type (s )== str # noqa: E721
@@ -462,15 +462,6 @@ def db_connect(self, dbname, user, password=None, host="localhost", port=5432):
462
462
)
463
463
return conn
464
464
465
- def _escape_path (path ):
466
- assert type (path )== str # noqa: E721
467
- assert path != "" # Ok?
468
-
469
- r = "'"
470
- r += path
471
- r += "'"
472
- return r
473
-
474
465
475
466
def normalize_error (error ):
476
467
if isinstance (error ,bytes ):