diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-10-29 13:03:53 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-10-29 13:03:53 -0300 |
commit | dba45ace351caa4c097f1ee1498e164cf4683a4f (patch) | |
tree | 7269328783217abe12cd9e730fa4e564a13c5521 /src/leap/bitmask/services/eip/vpnprocess.py | |
parent | 49db36a361a6fe027f2fffacf52d715b11cbdb52 (diff) | |
parent | c90be9157d5423d055984b354c5712f6873336b8 (diff) |
Merge remote-tracking branch 'ivan/bug/4189_fix-non-ascii-path-problem' into develop
Diffstat (limited to 'src/leap/bitmask/services/eip/vpnprocess.py')
-rw-r--r-- | src/leap/bitmask/services/eip/vpnprocess.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/leap/bitmask/services/eip/vpnprocess.py b/src/leap/bitmask/services/eip/vpnprocess.py index 19e1aa7b..51f0f738 100644 --- a/src/leap/bitmask/services/eip/vpnprocess.py +++ b/src/leap/bitmask/services/eip/vpnprocess.py @@ -23,6 +23,7 @@ import psutil import psutil.error import shutil import socket +import sys from itertools import chain, repeat @@ -864,15 +865,26 @@ class VPNProcess(protocol.ProcessProtocol, VPNManager): """ Gets the vpn command from the aproppriate launcher. - Might throw: VPNLauncherException, OpenVPNNotFoundException. + Might throw: + VPNLauncherException, + OpenVPNNotFoundException. + + :rtype: list of str """ - cmd = self._launcher.get_vpn_command( + command = self._launcher.get_vpn_command( eipconfig=self._eipconfig, providerconfig=self._providerconfig, socket_host=self._socket_host, socket_port=self._socket_port, openvpn_verb=self._openvpn_verb) - return map(str, cmd) + + encoding = sys.getfilesystemencoding() + for i, c in enumerate(command): + if not isinstance(c, str): + command[i] = c.encode(encoding) + + logger.debug("Running VPN with command: {0}".format(command)) + return command # shutdown |