{"id":21781,"library":"pyprctl","title":"pyprctl","description":"A pure-Python interface to Linux's prctl() syscall and related functionality (e.g., capabilities, process names, securebits) using ctypes. Version 0.1.3, released 2023-06-18. Low release cadence.","status":"active","version":"0.1.3","language":"python","source_language":"en","source_url":"https://github.com/cptpcrd/pyprctl","tags":["linux","prctl","capabilities","syscall","ctypes"],"install":[{"cmd":"pip install pyprctl","lang":"bash","label":"Default install"}],"dependencies":[],"imports":[{"note":"pyprctl.prctl is a module, not the function; use from-import","wrong":"import pyprctl.prctl","symbol":"prctl","correct":"from pyprctl import prctl"}],"quickstart":{"code":"from pyprctl import prctl\nfrom pyprctl.caps import Cap\n\n# Get current capability sets\npermitted = prctl.cap_get_pc()\neffective = prctl.cap_get_ec()\nprint(permitted, effective)\n\n# Check if a capability is supported\nif Cap.CAP_NET_RAW.is_supported():\n    print(\"CAP_NET_RAW is supported\")","lang":"python","description":"Demonstrates basic usage: querying capability sets and checking support."},"warnings":[{"fix":"Ensure argument is a str, not bytes.","message":"On Python <3.8, os.fsencode() may behave differently for process names; always pass str to prctl_set_name()","severity":"gotcha","affected_versions":">=0.1.3"},{"fix":"Remove follow_symlinks argument from FileCaps.get() / FileCaps.set() calls.","message":"v0.1.2 removed follow_symlinks parameter from FileCaps methods; code using it will break.","severity":"breaking","affected_versions":">=0.1.2"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use: from pyprctl import prctl","cause":"Did import pyprctl instead of from pyprctl import prctl","error":"AttributeError: module 'pyprctl' has no attribute 'prctl'"},{"fix":"Use: from pyprctl.caps import Cap","cause":"Cap class is in pyprctl.caps, not directly in pyprctl","error":"AttributeError: module 'pyprctl' has no attribute 'Cap'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}