File "C:\dev\workspace\personal\DataExtractor\main.py", line 21, in connect_to_wifi
winwifi.WinWiFi.add_profile(WIFI_NAME)
File "C:\dev\workspace\DataExtractor\Lib\site-packages\winwifi\main.py", line 141, in add_profile
cls.netsh(['wlan', 'add', 'profile', 'filename={}'.format(path)])
File "C:\dev\workspace\DataExtractor\Lib\site-packages\winwifi\main.py", line 98, in netsh
return subprocess.run(
^^^^^^^^^^^^^^^
File "C:\Python311\Lib\subprocess.py", line 569, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['netsh', 'wlan', 'add', 'profile', 'filename=C:\\Users\\guike\\AppData\\Local\\Temp\\tmpz50k3zi1']' returned non-zero exit status 1.
Process finished with exit code 1
Python 3.11
Windows 11 Pro 22H2
Code sample:
Stack trace:
Checked the tmpz50k3zi1 file and it has one line only containing the WIFI_NAME value.