kiranvizru / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Windows 8 UTF-8 decoding problem #491

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. install python 3.4 and psutil 2.0.0 on Windows 8
2. create system_infos.py file with the following line:
   import psutil
   net_info=psutil.network_io_counters(pernic=True)
   print(str(net_info))

3. python system_infos.py

What is the expected output?
{'lo': snetio(bytes_sent=112432, bytes_recv=112432, packets_sent=804, 
packets_recv=804, errin=0, errout=0, dropin=0, dropout=0), 'wlan0': 
snetio(bytes_sent=0, bytes_recv=0, packets_sent=0, packets_recv=0, errin=0, 
errout=0, dropin=0, dropout=0), 'eth1': snetio(bytes_sent=1228441, 
bytes_recv=17944089, packets_sent=7654, packets_recv=24378, errin=0, errout=0, 
dropin=0, dropout=0), 'eth0': snetio(bytes_sent=0, bytes_recv=0, 
packets_sent=0, packets_recv=0, errin=0, errout=0, dropin=0, dropout=0)}

What do you see instead?
Traceback (most recent call last):
  File "f:\system_infos.py", line 49, in <module>
    net_info=psutil.network_io_counters(pernic=True)
  File "c:\Python34\lib\site-packages\psutil\_common.py", line 125, in inner
    return fun(*args, **kwargs)
  File "c:\Python34\lib\site-packages\psutil\__init__.py", line 1855, in network
_io_counters
    return net_io_counters(pernic)
  File "c:\Python34\lib\site-packages\psutil\__init__.py", line 1758, in net_io_
counters
    rawdict = _psplatform.net_io_counters()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe1 in position 11: invalid
 continuation byte

What version of psutil are you using?
2.0.0
What Python version?
3.4

On what operating system? 
Windows 8
Is it 32bit or 64bit version?
64bit

Please provide any additional information below.
It works perfectly on Windows 7 and Ubuntu 12.04.

Original issue reported on code.google.com by szigeti....@gmail.com on 31 Mar 2014 at 1:56

GoogleCodeExporter commented 9 years ago
Closing out as duplicate of issue 446.

Original comment by g.rodola on 31 Mar 2014 at 4:55