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 got UnicodeDecodeError #993

Closed
zhenghan008 opened this issue Mar 20, 2017 · 2 comments
Closed

psutil got UnicodeDecodeError #993

zhenghan008 opened this issue Mar 20, 2017 · 2 comments

Comments

@zhenghan008
Copy link

zhenghan008 commented Mar 20, 2017

Hi.I met a problem.

import psutil
for each_process in psutil.pids():
    p = psutil.Process(each_process)
    print(p.as_dict()['name'])`

Error:

`fdlauncher.exe
SearchIndexer.exe
fdhost.exe
conhost.exe
svchost.exe
WUDFHost.exe
wmpnetwk.exe
QQProtect.exe
Traceback (most recent call last):
  File "E:/Server_Info/test.py", line 8, in <module>
    print(p.as_dict()['name'])
  File "D:\python35\lib\site-packages\psutil\__init__.py", line 563, in as_dict
    ret = meth()
  File "D:\python35\lib\site-packages\psutil\__init__.py", line 1178, in memory_maps
    for tupl in it:
  File "D:\python35\lib\site-packages\psutil\_pswindows.py", line 746, in memory_maps
    raw = cext.proc_memory_maps(self.pid)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xce in position 34: invalid continuation byte

My operating environment is win7 , python 3.5, psutil 5.2.

@giampaolo
Copy link
Owner

I should have a fix for this. Could you check whether you get this error also on Python 2.7?

@zhenghan008
Copy link
Author

@giampaolo ok!I got it. thank you!

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

2 participants