joshschmelzle / lswifi

a CLI-centric Wi-Fi scanning tool for Windows
https://pypi.org/project/lswifi/
BSD 3-Clause "New" or "Revised" License
49 stars 7 forks source link

decode issue when mapping interface to mac and name #32

Closed joshschmelzle closed 1 year ago

joshschmelzle commented 1 year ago

Discussed in https://github.com/joshschmelzle/lswifi/discussions/31

Originally posted by **dwe1we4w** November 16, 2022 I get an error when I use this command. `lswifi --json -t -100`Then I added gbk code according to the error information, and he was OK. This is an error message: `Exception in thread Thread-1: Traceback (most recent call last): File "c:\users\shaoshuai\appdata\local\programs\python\python38\lib\threading.py", line 932, in _bootstrap_inner self.run() File "c:\users\shaoshuai\appdata\local\programs\python\python38\lib\threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "c:\users\shaoshuai\appdata\local\programs\python\python38\lib\site-packages\lswifi\wlanapi.py", line 1592, in WirelessInterfaceThread ifaces[index] = WirelessInterface(info) File "c:\users\shaoshuai\appdata\local\programs\python\python38\lib\site-packages\lswifi\wlanapi.py", line 903, in __init__ self.map_guid_to_mac_and_connection_name(self.guid, self.description) File "**c:\users\shaoshuai\appdata\local\programs\python\python38\lib\site-packages\lswifi\wlanapi.py**", line 919, in map_guid_to_mac_and_connection_name for line in output.decode().splitlines(): UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc1 in position 1: invalid start byte`
joshschmelzle commented 1 year ago

Should be fixed in v0.1.31 with https://github.com/joshschmelzle/lswifi/commit/344a492c801441db2890b5a6b0ee9b3d5b647850