{"id":23693,"library":"exitstatus","title":"exitstatus","description":"A Python library that provides named constants for POSIX exit status codes (e.g., EX_OK, EX_USAGE, EX_SOFTWARE). Current version 2.7.0, requires Python >=3.10. Release cadence is roughly once per year, following Python version support.","status":"active","version":"2.7.0","language":"python","source_language":"en","source_url":"https://github.com/johnthagen/exitstatus","tags":["posix","exit-codes","enum","convenience"],"install":[{"cmd":"pip install exitstatus","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"ExitStatus is an IntEnum subclass that defines all POSIX exit codes.","symbol":"ExitStatus","correct":"from exitstatus import ExitStatus"},{"note":"Do not import individual constants directly; they were removed in v2.0.0. Use the ExitStatus enum instead.","wrong":"from exitstatus import EX_OK","symbol":"EX_OK","correct":"from exitstatus import ExitStatus\nexit_code = ExitStatus.success"}],"quickstart":{"code":"import sys\nfrom exitstatus import ExitStatus\n\nsys.exit(ExitStatus.success)  # exit code 0\n# sys.exit(ExitStatus.failure)  # exit code 1\n# sys.exit(ExitStatus.usage)    # exit code 64","lang":"python","description":"Use ExitStatus IntEnum for clear, self-documenting exit codes."},"warnings":[{"fix":"Use 'from exitstatus import ExitStatus' and reference ExitStatus.success etc.","message":"In v2.0.0, the library was rewritten to use an IntEnum; direct imports of EX_* constants (like 'from exitstatus import EX_OK') no longer work.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Upgrade Python to 3.10+ or use exitstatus <=2.6.0.","message":"Python 3.9 and earlier are no longer supported as of v2.7.0.","severity":"deprecated","affected_versions":">=2.7.0"},{"fix":"Use 'sys.exit(ExitStatus.success) == 0' or 'if code == ExitStatus.success:'.","message":"ExitStatus enum values are integers, but they are not compatible with plain int in some strict type checkers if you compare using 'is' instead of '=='. Always compare with '=='.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from exitstatus import ExitStatus' and access ExitStatus.success.","cause":"Direct import of EX_* constants was removed in v2.0.0.","error":"ImportError: cannot import name 'EX_OK' from 'exitstatus'"},{"fix":"Use 'from exitstatus import ExitStatus' and then ExitStatus.success.","cause":"Trying to access EX_OK directly on the module after importing exitstatus.","error":"AttributeError: module 'exitstatus' has no attribute 'EX_OK'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}