Skip to main content

Exception formatter that produces readable stack traces.

Project description

dexc

This Python project is an exception formatter that produces readable stack traces.

It only supports Python 3.12 and later.

Features

Current features

  • Context displayed in addition to the trace line of each frame
  • Reversed frame order i.e. JavaScript-like
  • Truncated trace lines when there are too many
  • Colorized stack trace obeying the the NO_COLOR environment variable
  • Minimzed frames when those are not part of the user code
  • Support for exception groups
  • Highlighting of re-raises i.e. when an exception is caught and re-raised with more than a simple raise, causing two stack traces to be concatenated without separation
  • Formatting of unraisable exceptions e.g. raised in a destructor
  • Support for syntax errors

Future features

  • Better checks e.g. when the column number is not available but the line number is
  • Improve support for exception groups
  • User vs lib tb kinds
  • Avoid repeating recursive calls e.g. infinite loop
  • Maximum screen width
  • Option to reverse order
  • Better highlight re-raises
  • More ast nodes supported
  • More precise ast node targeting e.g. should work if all statements are on the same line
  • Handle multiprocessing.pool.RemoteTraceback which currently is text
  • Better highlighting using ast data (e.g. only highlight first line of for loop)
  • Formatting of exceptions raised in threads
  • Better handling of file paths e.g. site-packages
  • Perhaps syntax highlighting
  • Avoid highlighting large nodes e.g. highlight a function and parentheses instead of the arguments if the function call is failing
  • Other escape codes e.g. curly underlines or clickable file names
  • Other characters

Installation

$ pip install dexc

Usage

import dexc
dexc.install()

Prior art

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dexc-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

dexc-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file dexc-0.1.0.tar.gz.

File metadata

  • Download URL: dexc-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for dexc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d9438c1a061f7de35e4a627839ba3b41cda091ed2306dbb2eb06d379c1708381
MD5 1945b3e65a3a7f96abdb6eb479ffc908
BLAKE2b-256 d9d8a05347032f620c8d538c196c001b8d7664fa6e01f8ad60bebfc08c76fc3b

See more details on using hashes here.

File details

Details for the file dexc-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dexc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for dexc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 83011e588deb4cc5984da930e69039fbccf9ea495743a77ee7b8a4fec1575e59
MD5 f124f684b6abecd8c8d76a7881b7e18b
BLAKE2b-256 611109522c5a594dec6d18d7c55a7b2821d646c412006cd9b96df26b776275e9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page