kamene icon indicating copy to clipboard operation
kamene copied to clipboard

Meet UnicodeDecodeError.

Open dengbo22 opened this issue 9 years ago • 2 comments

Operation System: Windows 10. Python Version: 3.5 The Error is as follow:

Traceback (most recent call last):
  File "E:/WorkStation/Python/NetWork/main.py", line 2, in <module>
    from scapy.all import *;
  File "C:\Users\Tiny\AppData\Local\Programs\Python\Python35-32\lib\site-packages\scapy\all.py", line 16, in <module>
    from .arch import *
  File "C:\Users\Tiny\AppData\Local\Programs\Python\Python35-32\lib\site-packages\scapy\arch\__init__.py", line 88, in <module>
    from .windows import *
  File "C:\Users\Tiny\AppData\Local\Programs\Python\Python35-32\lib\site-packages\scapy\arch\windows\__init__.py", line 198, in <module>
    ifaces.load_from_powershell()
  File "C:\Users\Tiny\AppData\Local\Programs\Python\Python35-32\lib\site-packages\scapy\arch\windows\__init__.py", line 149, in load_from_powershell
    for i in get_windows_if_list():
  File "C:\Users\Tiny\AppData\Local\Programs\Python\Python35-32\lib\site-packages\scapy\arch\windows\__init__.py", line 90, in get_windows_if_list
    current_interface['name'] = value.decode('ascii')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd2 in position 0: ordinal not in range(128)

When the exception was thrown, the value = b'\xd2\xd4\xcc\xab\xcd\xf8'

dengbo22 avatar Jul 18 '16 08:07 dengbo22

I have the same problem. My system is running on Windows 10 (Korean Ver.) with Python 3.5.2 (64 bit) . Should we modify the code in init.py to value.decode('utf-8')?

inux1 avatar Aug 04 '16 01:08 inux1

Tested, reasonable code commits are always welcome :) . Though I must say I have used existing code with Windows 10 without such an issue, so it should at least be investigated. Most likely it is non-English Windows or some changes brought in by some later Windows update (in which case it could be more than this change required).

phaethon avatar Aug 04 '16 05:08 phaethon