|
37 | 37 | from mig.shared.accountreq import build_accountreqitem_object, \ |
38 | 38 | list_account_reqs, get_account_req, accept_account_req, \ |
39 | 39 | peer_account_req, reject_account_req |
40 | | -from mig.shared.base import force_native_str_rec, force_native_str |
| 40 | +from mig.shared.base import force_native_str_rec |
41 | 41 | from mig.shared.defaults import default_pager_entries, csrf_field, \ |
42 | 42 | keyword_any, keyword_auto, AUTH_CERTIFICATE, AUTH_OPENID_V2, \ |
43 | 43 | AUTH_OPENID_CONNECT |
@@ -359,12 +359,13 @@ def main(client_id, user_arguments_dict, environ=None): |
359 | 359 | '/sbin/sshd -f /etc/ssh/sshd_config-MiG-sftp-subsys') |
360 | 360 | for proc in daemon_names: |
361 | 361 | # NOTE: we use command list here to avoid shell requirement |
| 362 | + # NOTE: we want utf8-encoded output as text str for status below |
362 | 363 | pgrep_proc = subprocess_popen(['pgrep', '-f', proc], |
363 | 364 | stdout=subprocess_pipe, |
364 | | - stderr=subprocess_stdout) |
| 365 | + stderr=subprocess_stdout, |
| 366 | + text=True) |
365 | 367 | pgrep_proc.wait() |
366 | | - # NOTE: output is system native encoding and we need native string |
367 | | - ps_out = force_native_str(pgrep_proc.stdout.read().strip()) |
| 368 | + ps_out = pgrep_proc.stdout.read().strip() |
368 | 369 | if pgrep_proc.returncode == 0: |
369 | 370 | daemons += "<div class='status_online'>%s running (pid %s)</div>" \ |
370 | 371 | % (proc, ps_out) |
@@ -559,7 +560,7 @@ def main(client_id, user_arguments_dict, environ=None): |
559 | 560 | '''}) |
560 | 561 |
|
561 | 562 | # Finish tabs wrap |
562 | | - output_objects.append({'object_type': 'html_form', 'text': ''' |
| 563 | + output_objects.append({'object_type': 'html_form', 'text': ''' |
563 | 564 | </div> |
564 | 565 | '''}) |
565 | 566 |
|
|
0 commit comments