{"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":[{"wrong":"from crashtest import Inspector","symbol":"annotations","correct":"from crashtest import annotations"}],"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,"search_vec":"'0.4.1':29 'cadenc':35 'crashtest':1,2 'current':26 'debug':47 'design':7 'eas':23 'error':21,45 'except':15,48 'focus':39 'handl':11,46 'hint':44 'inspect':13 'librari':6 'manag':19,49 'moder':33 'provid':16 'python':5,20 'recent':37 'releas':34 'simplifi':9 'stabil':41 'tool':17 'type':43 'updat':38 'version':28","created_at":"2026-03-28T15:15:04.068663+00:00","updated_at":"2026-04-16T04:00:08.090441+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":0,"quickstart_score":0,"quickstart_tag":"stale","pypi_latest":"0.4.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/sdispater/crashtest","docs":null,"changelog":null,"pypi":"https://pypi.org/project/crashtest/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing","observability"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":"stale"}}