Description:
I encountered a blocking UnicodeDecodeError while running the Wizard or starting the service on Ubuntu 24.04 (Python 3.12). The addon fails when it attempts to verify system commands (openvpn, killall) via sudo.
Root Cause:
On non-English localized systems (specifically French/FR), sudo outputs localized error messages or prompts (e.g., using "é" in "mot de passe" or "autorisé"). When vpnplatform.py calls log_file.readlines(), it defaults to ASCII decoding, which crashes upon encountering the 0xc3 byte (UTF-8 multi-byte character).
Error Log:
Python
Error Type: <class 'UnicodeDecodeError'>
Error Contents: 'ascii' codec can't decode byte 0xc3 in position 37: ordinal not in range(128)
Traceback (most recent call last):
File ".../service.vpn.manager/libs/vpnplatform.py", line 392, in checkKillallCommand
log_file_lines = log_file.readlines()
File "/usr/lib/python3.12/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 37: ordinal not in range(128)
Environment:
OS: Ubuntu 24.04 LTS (Linux)
Kodi Version: 20.5 (Nexus)
Addon Version: 7.0.3
Python Version: 3.12
Current Workaround:
Launching Kodi with LC_ALL=en_US.UTF-8 kodi bypasses the issue by forcing sudo to output plain ASCII, but the addon should ideally handle UTF-8 encoding when reading log files or command outputs to support non-English locales.
Description:
I encountered a blocking UnicodeDecodeError while running the Wizard or starting the service on Ubuntu 24.04 (Python 3.12). The addon fails when it attempts to verify system commands (openvpn, killall) via sudo.
Root Cause:
On non-English localized systems (specifically French/FR), sudo outputs localized error messages or prompts (e.g., using "é" in "mot de passe" or "autorisé"). When vpnplatform.py calls log_file.readlines(), it defaults to ASCII decoding, which crashes upon encountering the 0xc3 byte (UTF-8 multi-byte character).
Error Log:
Python
Error Type: <class 'UnicodeDecodeError'>
Error Contents: 'ascii' codec can't decode byte 0xc3 in position 37: ordinal not in range(128)
Traceback (most recent call last):
File ".../service.vpn.manager/libs/vpnplatform.py", line 392, in checkKillallCommand
log_file_lines = log_file.readlines()
File "/usr/lib/python3.12/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 37: ordinal not in range(128)
Environment:
OS: Ubuntu 24.04 LTS (Linux)
Kodi Version: 20.5 (Nexus)
Addon Version: 7.0.3
Python Version: 3.12
Current Workaround:
Launching Kodi with LC_ALL=en_US.UTF-8 kodi bypasses the issue by forcing sudo to output plain ASCII, but the addon should ideally handle UTF-8 encoding when reading log files or command outputs to support non-English locales.