Open swaHekuL opened 3 years ago
Hello I have the same problem. I am trying to scan wifi network doing data=winwifi.WinWiFi.scan() and get the same error, The same script and configuration works on one of my other PC. I don't get the issue. Any idea how to resolve it ?
Thanks in advance
Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] Type "copyright", "credits" or "license" for more information.
IPython 7.19.0 -- An enhanced Interactive Python.
runfile('D:/Musique/wifi-adam/fichier-test.py', wdir='D:/Musique/wifi-adam') Exception in thread Thread-7: Traceback (most recent call last): File "C:\Users\Adam\anaconda3\lib\threading.py", line 932, in _bootstrap_inner self.run() File "C:\Users\Adam\anaconda3\lib\threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "C:\Users\Adam\anaconda3\lib\subprocess.py", line 1366, in _readerthread buffer.append(fh.read()) File "C:\Users\Adam\anaconda3\lib\codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 21: invalid start byte Traceback (most recent call last):
File "D:\Musique\wifi-adam\fichier-test.py", line 65, in
File "C:\Users\Adam\anaconda3\lib\site-packages\winwifi\main.py", line 162, in scan cp: subprocess.CompletedProcess = cls.netsh(['wlan', 'show', 'networks', 'mode=bssid'])
File "C:\Users\Adam\anaconda3\lib\site-packages\winwifi\main.py", line 98, in netsh return subprocess.run(
File "C:\Users\Adam\anaconda3\lib\subprocess.py", line 491, in run stdout, stderr = process.communicate(input, timeout=timeout)
File "C:\Users\Adam\anaconda3\lib\subprocess.py", line 1024, in communicate stdout, stderr = self._communicate(input, endtime, timeout)
File "C:\Users\Adam\anaconda3\lib\subprocess.py", line 1416, in _communicate stdout = stdout[0]
IndexError: list index out of range
I'm trying to simply disconnect my computer from WiFi and reconnect it every morning, and when I try to connect to a network, I get this error.
Exception in thread Thread-1: Traceback (most recent call last): File "C:\Users\lthaw\AppData\Local\Programs\Python\Python39\lib\threading.py", line 954, in _bootstrap_inner self.run() File "C:\Users\lthaw\AppData\Local\Programs\Python\Python39\lib\threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "C:\Users\lthaw\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1475, in _readerthread buffer.append(fh.read()) File "C:\Users\lthaw\AppData\Local\Programs\Python\Python39\lib\codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x83 in position 10826: invalid start byte Traceback (most recent call last): File "C:/Users/lthaw/Desktop/wifi test 3.py", line 3, in
winwifi.WinWiFi.scan()
File "C:\Users\lthaw\AppData\Local\Programs\Python\Python39\lib\site-packages\winwifi\main.py", line 162, in scan
cp: subprocess.CompletedProcess = cls.netsh(['wlan', 'show', 'networks', 'mode=bssid'])
File "C:\Users\lthaw\AppData\Local\Programs\Python\Python39\lib\site-packages\winwifi\main.py", line 98, in netsh
return subprocess.run(
File "C:\Users\lthaw\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 503, in run
stdout, stderr = process.communicate(input, timeout=timeout)
File "C:\Users\lthaw\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1130, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "C:\Users\lthaw\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1525, in _communicate
stdout = stdout[0]
IndexError: list index out of range
I'm rather inexperienced with Python overall, I've taken some college courses and that's about it. Any help would be appreciated.