Make hostwatch locale-independent (#379)

* Make hostwatch locale-independent

See #377: hostwatch used to call netstat and parse the result,
without setting the locale.
The problem is converting the binary output to a unicode string,
as the locale may be utf-8, latin-1, or literally anything.
Setting the locale to C avoids this issue, as netstat's source
strings to not use non-ASCII characters.

* Break line, check all other invocations
This commit is contained in:
Ben Wiederhake
2019-11-09 01:27:57 +01:00
committed by Brian May
parent 23516ebd71
commit 6ad4473c87
5 changed files with 27 additions and 5 deletions

View File

@ -220,6 +220,7 @@ class FirewallClient:
if argv[0] == 'su':
sys.stderr.write('[local su] ')
self.p = ssubprocess.Popen(argv, stdout=s1, preexec_fn=setup)
# No env: Talking to `FirewallClient.start`, which has no i18n.
e = None
break
except OSError as e: