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

Crashes with malformed UTF-8 sequences in process command lines #515

Closed
nicolargo opened this issue Jun 28, 2014 · 1 comment
Closed

Crashes with malformed UTF-8 sequences in process command lines #515

nicolargo opened this issue Jun 28, 2014 · 1 comment

Comments

@nicolargo
Copy link
Contributor

Hi, a Glances' user report me an issue on the process command line with malformed UTF8 chars. See complete report here: nicolargo/glances#391

Extract:

 File "/usr/lib/python3.4/site-packages/psutil/__init__.py", line 551, in cmdline
    return self._proc.cmdline()
  File "/usr/lib/python3.4/site-packages/psutil/_pslinux.py", line 694, in wrapper
    return fun(self, *args, **kwargs)
  File "/usr/lib/python3.4/site-packages/psutil/_pslinux.py", line 771, in cmdline
    return [x for x in f.read().split('\x00') if x]
  File "/usr/lib/python3.4/codecs.py", line 313, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 61: unexpected end of data

Can you have a look on it ?

@giampaolo
Copy link
Owner

Hey there, sorry for the late reply. I think psutil is doing the right thing in letting that kind of exception propagate. It should be up to the app (e.g. glances) to decide what to do in that situation. For the record, I think it's likely that the OP problem is related to the terminal using a locale different than UTF-8. I'm going to close this out as won't fix.

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