Выдаёт ошибку, как исправить?

import subprocess, re, sys

command = "netsh wlan show profile"
networks = subprocess.check_output(command, shell=True)
networks1 = networks.replace("Все профили пользователей", "All User Profiles")
networks2 = networks1.replace("‚ᥠЇа®дЁ«Ё Ї®«м§®ў вҐ«Ґ©", "All User Profiles")
networks_names_list = re.findall("(?:All\sUser\sProfiles\s*:\s)(.*)", networks2)
result = ""

for networks_name in networks_names_list:
    command = "netsh wlan show profile " + networks_name + " key=clear"
    current_result = subprocess.check_output(command, shell=True)
    result = result + current_result
print(result)

ошибка

Exception in thread Thread-3:
Traceback (most recent call last):
  File "C:\Users\l0git\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\Users\l0git\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\l0git\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1366, in _readerthread
    buffer.append(fh.read())
  File "C:\Users\l0git\AppData\Local\Programs\Python\Python38-32\lib\encodings\cp1251.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 391: character maps to <undefined>
Traceback (most recent call last):
  File "C:\Users\l0git\Desktop\проги-проэкты\проекты\remouter.py", line 10, in <module>
    current_result = subprocess.check_output(command, shell=True)
  File "C:\Users\l0git\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Users\l0git\AppData\Local\Programs\Python\Python38-32\lib\site-packages\run\__init__.py", line 168, in stdout
    return std_output(self.process.communicate()[0])
  File "C:\Users\l0git\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1024, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "C:\Users\l0git\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1416, in _communicate
    stdout = stdout[0]
IndexError: list index out of range

должен выводить имя и пароль от WIFI


Ответы (0 шт):