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

Properly catch permission issues #31

Open
astrofrog opened this issue May 21, 2018 · 0 comments
Open

Properly catch permission issues #31

astrofrog opened this issue May 21, 2018 · 0 comments

Comments

@astrofrog
Copy link
Owner

When trying to monitor a root process, one can get the following error:

AccessDenied: psutil.AccessDenied (pid=126)

in psutil - but in psrecord this shows up as:

Traceback (most recent call last):
  File "/Users/tom/miniconda3/envs/dev/bin/psrecord", line 7, in <module>
    sys.exit(psrecord.main())
  File "/Users/tom/miniconda3/envs/dev/lib/python3.6/site-packages/psrecord/main.py", line 109, in main
    interval=args.interval, include_children=args.include_children)
  File "/Users/tom/miniconda3/envs/dev/lib/python3.6/site-packages/psrecord/main.py", line 218, in monitor
    ax.set_ylim(0., max(log['cpu']) * 1.2)
ValueError: max() arg is an empty sequence

We should do a better job of propagating the access denied error up (usually indicates sudo should be used).

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

No branches or pull requests

1 participant