Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psutil decode error #652

Closed
PyEldar opened this issue Jul 13, 2015 · 3 comments
Closed

psutil decode error #652

PyEldar opened this issue Jul 13, 2015 · 3 comments

Comments

@PyEldar
Copy link

PyEldar commented Jul 13, 2015

Hi, I have unrecognized problem in my code when using "psutil" module:

--------------------------------------------------------------------------------------------------------------------------
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import psutil
>>> psutil.net_if_addrs()
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    psutil.net_if_addrs()
  File "C:\Python34-32bit\lib\site-packages\psutil\__init__.py", line 1763, in net_if_addrs
    rawlist = _psplatform.net_if_addrs()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf8 in position 1: invalid start byte
>>> psutil.net_if_stats()
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    psutil.net_if_stats()
  File "C:\Python34-32bit\lib\site-packages\psutil\__init__.py", line 1795, in net_if_stats
    return _psplatform.net_if_stats()
  File "C:\Python34-32bit\lib\site-packages\psutil\_pswindows.py", line 217, in net_if_stats
    ret = cext.net_if_stats()
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 1-2: invalid continuation byte
-------------------------------------------------------------------------------------------------------------------------

OS: windows 8.1 64bit
Python: 3.4.3 32bit
Psutil: 3.0.1

@mrjefftang
Copy link
Collaborator

Can you paste in the output of ipconfig /all from a command prompt?

@PyEldar
Copy link
Author

PyEldar commented Jul 15, 2015

Of course .... i do not know if letters like "ř" or "í" can cause the problem but i saw them in the names of adapters in ipconfig /all output ...... and i saw asterisk(*) there too ...... but I do not think it could be so simple

Here is the output:

Windows IP Configuration

   Host Name . . . . . . . . . . . . : Acer_006
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No

Wireless LAN adapter Připojení k místní síti* 4:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft Hosted Network Virtual Adapter
   Physical Address. . . . . . . . . : 5E-D2-1E-8D-68-21
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Wireless LAN adapter Připojení k místní síti* 3:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft Wi-Fi Direct Virtual Adapter
   Physical Address. . . . . . . . . : 1E-D2-1E-8D-68-21
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Qualcomm Atheros AR5BWB222 Wireless Netwo
rk Adapter
   Physical Address. . . . . . . . . : 9C-D2-1E-8D-68-21
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::7904:40cd:ca91:ec31%4(Preferred)
   IPv4 Address. . . . . . . . . . . : 10.0.0.13(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.0.0.0
   Lease Obtained. . . . . . . . . . : 14. července 2015 22:40:40
   Lease Expires . . . . . . . . . . : 16. července 2015 19:52:21
   Default Gateway . . . . . . . . . : 10.0.0.2
   DHCP Server . . . . . . . . . . . : 10.0.0.2
   DHCPv6 IAID . . . . . . . . . . . : 77386270
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1A-DA-45-09-20-25-64-91-35-67

   DNS Servers . . . . . . . . . . . : 10.0.0.2
   NetBIOS over Tcpip. . . . . . . . : Enabled

Ethernet adapter Síť Ethernet:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Broadcom NetLink (TM) Gigabit Ethernet
   Physical Address. . . . . . . . . : 20-25-64-91-35-67
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter Teredo Tunneling Pseudo-Interface:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   IPv6 Address. . . . . . . . . . . : 2001:0:5ef5:79fb:cd:2a53:af43:9de6(Prefer
red)
   Link-local IPv6 Address . . . . . : fe80::cd:2a53:af43:9de6%7(Preferred)
   Default Gateway . . . . . . . . . : ::
   DHCPv6 IAID . . . . . . . . . . . : 436207616
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1A-DA-45-09-20-25-64-91-35-67

   NetBIOS over Tcpip. . . . . . . . : Disabled

Tunnel adapter isatap.{C1AD76A8-0586-4471-B9DF-8CC5E49C75B4}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

@giampaolo
Copy link
Owner

OK, this should now be fixed as part of #650.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants