@@ -342,7 +342,7 @@ def _test_config(self):
342
342
]
343
343
p = subprocess .run (popen_list , stdout = subprocess .PIPE , stderr = subprocess .STDOUT )
344
344
if p .returncode != 0 :
345
- self .logger .error (p .stdout .decode ("utf-8" ))
345
+ self .logger .error (p .stdout .decode ("utf-8" , errors = "replace" ))
346
346
raise RuntimeError ("configuration test failed" )
347
347
self .logger .info ("config ok: %s" , self ._slapd_conf )
348
348
@@ -479,14 +479,14 @@ def _cli_popen(
479
479
self .logger .debug ("Run command: %r" , " " .join (args ))
480
480
proc = subprocess .run (args , input = stdin_data , capture_output = True )
481
481
self .logger .debug (
482
- "stdin_data=%s" , stdin_data .decode ("utf-8" ) if stdin_data else stdin_data
482
+ "stdin_data=%s" , stdin_data .decode ("utf-8" , errors = "replace" ) if stdin_data else stdin_data
483
483
)
484
484
485
485
if proc .stdout is not None :
486
- self .logger .debug ("stdout=%s" , proc .stdout .decode ("utf-8" ))
486
+ self .logger .debug ("stdout=%s" , proc .stdout .decode ("utf-8" , errors = "replace" ))
487
487
488
488
if proc .stderr is not None :
489
- self .logger .debug ("stderr=%s" , proc .stderr .decode ("utf-8" ))
489
+ self .logger .debug ("stderr=%s" , proc .stderr .decode ("utf-8" , errors = "replace" ))
490
490
491
491
if proc .returncode not in expected :
492
492
raise RuntimeError (
0 commit comments