{"id":472,"library":"crashtest","title":"Crashtest","description":"Crashtest is a Python library designed to simplify the handling and inspection of exceptions, providing tools to manage Python errors with ease. It is currently at version 0.4.1 and has a moderate release cadence, with recent updates focused on stability and type hinting.","status":"active","version":"0.4.1","language":"python","source_language":"en","source_url":"https://github.com/sdispater/crashtest","tags":["error handling","debugging","exception management"],"install":[{"cmd":"pip install crashtest","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"Inspector","correct":"from crashtest import Inspector"},{"symbol":"ErrorHandler","correct":"from crashtest import ErrorHandler"}],"quickstart":{"code":"import sys\nfrom crashtest import Inspector\n\ndef might_fail():\n    a = 1\n    b = 0\n    return a / b\n\ntry:\n    might_fail()\nexcept Exception as e:\n    inspector = Inspector(e)\n    print(f\"Exception type: {inspector.type}\")\n    print(f\"Exception message: {inspector.message}\")\n    print(\"Stack Trace:\")\n    for frame in inspector.frames:\n        print(f\"  File: {frame.file}, Line: {frame.lineno}, Function: {frame.name}\")\n        print(f\"    Code: {frame.line.strip() if frame.line else 'N/A'}\")\n","lang":"python","description":"Demonstrates how to use the `Inspector` class to extract detailed information from a caught exception, including its type, message, and the full stack trace with code context."},"warnings":[{"fix":"Upgrade your Python environment to 3.7 or newer, or pin `crashtest` to a version older than 0.4.0 (e.g., `<0.4.0`).","message":"Crashtest versions 0.4.0 and newer require Python 3.7 or higher. Users on Python 3.6 or older will encounter compatibility issues when upgrading.","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"Update to `crashtest` 0.4.1 or later to benefit from the corrected type definitions and avoid potential type-related runtime errors.","message":"Version 0.4.0 introduced stricter type hinting. A 'too narrow type' in the `Inspector` class was fixed in 0.4.1, suggesting that `0.4.0` might have introduced new type-related errors if existing code passed unexpected types.","severity":"gotcha","affected_versions":"0.4.0"},{"fix":"Upgrade to `crashtest` 0.4.0 or later to ensure proper handling of file encodings.","message":"Prior to version 0.4.0, `crashtest` could encounter decoding errors when opening files due to the lack of explicit 'utf-8' encoding.","severity":"gotcha","affected_versions":"<0.4.0"},{"fix":"Upgrade to `crashtest` 0.3.1 or later to fix issues with context-less frame line retrieval.","message":"In versions prior to 0.3.1, there was an error when attempting to retrieve the line of a frame if it had no context.","severity":"gotcha","affected_versions":"<0.3.1"},{"fix":"Update import statements from `from crashtest import Inspector` to `from crashtest.inspector import Inspector` to correctly import the class.","message":"The `Inspector` class was moved from being directly available under the `crashtest` package to `crashtest.inspector` in version 0.4.0. Attempts to import it directly via `from crashtest import Inspector` will result in an `ImportError` in versions 0.4.0 and newer.","severity":"breaking","affected_versions":">=0.4.0"}],"env_vars":null,"last_verified":"2026-05-12T14:05:00.622Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Install the library using pip: `pip install crashtest`","cause":"The 'crashtest' library is not installed in your Python environment or is not accessible on the Python path.","error":"ModuleNotFoundError: No module named 'crashtest'"},{"fix":"When creating a `crashtest.Crash` object, provide an exception instance (e.g., caught in an `except` block) or a frame object: `crashtest.Crash(e)` or `crashtest.Crash(sys.exc_info()[2].tb_frame)`.","cause":"The `crashtest.Crash` class was instantiated without providing the mandatory `exception_or_frame` argument, which expects an exception instance or a frame object.","error":"TypeError: Crash() missing 1 required positional argument: 'exception_or_frame'"},{"fix":"Consult the `crashtest` documentation for the correct attributes and methods available on the `Crash` object, or use `dir(crash_instance)` to inspect its members.","cause":"You are attempting to access an attribute or method on a `crashtest.Crash` instance that does not exist or is misspelled.","error":"AttributeError: 'Crash' object has no attribute 'some_invalid_attribute'"}],"ecosystem":"pypi","meta_description":null,"install_score":0,"install_tag":"stale","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}