Skip to main content

traceback with more exact location info

Project description

CI status PyPI Installs Supported Python Versions

loctraceback

Want to see more precisely where you are or were at in a traceback or callstack your Python code has several places in a line it could have errored? Even if the code was something created at runtime with say eval or exec or if there was no source code that can be found?

Then this package is for you.

Some examples of the kinds of code this module can disambiguate:

i / j / k                              # which divide?
prev[prev[0]]                          # which prev ?
[e[0] for i in d[j] if got[i] == e[i]] # lots going on here
exec(some_code % 10, namespace)        # code at runtime

Some example output given by running code in example:

Division example:

Traceback (most recent call last):
  File "tb-div.py", line 9, in <module> at offset 52
    a / b / c
    a / b / c
      -
ZeroDivisionError: float division by zero

List comprehension example:

File "tb-comp.py", line 9, in <listcomp> at offset 18
    [e[0] for i in d[j] if got[i] == e[i]]
return [ e[0] for i in .0 if got[i] == e[i] ]
                             ------
IndexError: list index out of range

exec example:

Traceback (most recent call last):
 File "tb-exec.py", line 11, in <module> at offset 39
    exec(s)
    exec(s)
    -------
  File "<string>", line 4, in <module> at offset 18
  z = x / y
        -
  ZeroDivisionError: division by zero

Isolating function in call stack example:

File "call-fib.py", line 8, in fib at offset 58
  return fib(n-1) + fib(n-2)
  return fib(n - 1) + fib(n - 2)
                      ----------
    File "call-fib.py", line 10, in <module> at offset 54
         print("fib({})={}".format(2, fib(2)))
                                      ------

This modules extends the Python 3.6 API traceback module by adding in fragment decomplation info for more precise location information.

Although the API is from Python 3.6, the code runs on 3.3 or greater. Back-porting to ther Python versions is left as an exercise to the reader.

See these slides for information on the technology behind this.

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

loctraceback-1.1.1.tar.gz (24.3 kB view details)

Uploaded Source

Built Distributions

loctraceback-1.1.1-py37-none-any.whl (12.8 kB view details)

Uploaded Python 3.7

loctraceback-1.1.1-py35-none-any.whl (12.8 kB view details)

Uploaded Python 3.5

loctraceback-1.1.1-py34-none-any.whl (12.8 kB view details)

Uploaded Python 3.4

loctraceback-1.1.1-py33-none-any.whl (14.8 kB view details)

Uploaded Python 3.3

loctraceback-1.1.1-py3.8.egg (25.5 kB view details)

Uploaded Source

loctraceback-1.1.1-py3.7.egg (25.4 kB view details)

Uploaded Source

loctraceback-1.1.1-py3.6.egg (25.4 kB view details)

Uploaded Source

loctraceback-1.1.1-py3.5.egg (25.8 kB view details)

Uploaded Source

loctraceback-1.1.1-py3.4.egg (25.9 kB view details)

Uploaded Source

loctraceback-1.1.1-py3.3.egg (26.1 kB view details)

Uploaded Source

File details

Details for the file loctraceback-1.1.1.tar.gz.

File metadata

  • Download URL: loctraceback-1.1.1.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for loctraceback-1.1.1.tar.gz
Algorithm Hash digest
SHA256 8b6936ae38ce86a100df1ce755908e8248d85112f7227399eefb207801baadf5
MD5 bd407a696fc302557298100e2eae9940
BLAKE2b-256 4c19cf123589be67ae61cd90911753c37f67d861f031c618e75df445faffe7f2

See more details on using hashes here.

File details

Details for the file loctraceback-1.1.1-py37-none-any.whl.

File metadata

  • Download URL: loctraceback-1.1.1-py37-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3.7
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for loctraceback-1.1.1-py37-none-any.whl
Algorithm Hash digest
SHA256 c2efc711324497046b2432a272c30b32da73edd196acf707152ef10614793020
MD5 258d2b8159e89d0f89aca20532e6fce7
BLAKE2b-256 4983fc9502242df444888946bfb10aa38249adc572653838bf129242e7760490

See more details on using hashes here.

File details

Details for the file loctraceback-1.1.1-py35-none-any.whl.

File metadata

  • Download URL: loctraceback-1.1.1-py35-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3.5
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for loctraceback-1.1.1-py35-none-any.whl
Algorithm Hash digest
SHA256 ddf207b7cddfca4b5c610636dee692f88174be324e2d98e9ecb032f5a0c7cea8
MD5 dc172140816657828bb8ace6d800dd20
BLAKE2b-256 ee6558306550ea6a2bddb24ff7c44534bf662de53c3ba4a35660f519ed7cc96e

See more details on using hashes here.

File details

Details for the file loctraceback-1.1.1-py34-none-any.whl.

File metadata

  • Download URL: loctraceback-1.1.1-py34-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3.4
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for loctraceback-1.1.1-py34-none-any.whl
Algorithm Hash digest
SHA256 40c79f39bd49b127971605296dfeb812df6199cf415e379b700a0e9e194534f4
MD5 dd7190482d7221fc41d1a6c60949c00e
BLAKE2b-256 1be16c841eea242d8d412444838d54a5d233373acb07fd3ab0fdd64022eff1ac

See more details on using hashes here.

File details

Details for the file loctraceback-1.1.1-py33-none-any.whl.

File metadata

  • Download URL: loctraceback-1.1.1-py33-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3.3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for loctraceback-1.1.1-py33-none-any.whl
Algorithm Hash digest
SHA256 e1436558841b7845a0a979ed546d47c74bedb41cb9fdefdf88a46177d53cdf83
MD5 7f83c2996865688e95174771e24deab6
BLAKE2b-256 cc16a186e796ca57c0f916bbedbd98b4b9a251b5b921199cb00bd12392784d83

See more details on using hashes here.

File details

Details for the file loctraceback-1.1.1-py3.8.egg.

File metadata

  • Download URL: loctraceback-1.1.1-py3.8.egg
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for loctraceback-1.1.1-py3.8.egg
Algorithm Hash digest
SHA256 1e49b563566698ca7200910cd8541c43b1515c62f68866fb12095b2a3fe6ab53
MD5 61c81ee4f92e0c3281d193194b0084dd
BLAKE2b-256 10f8c15ba9f9a75aa00a41f0491686e7e0e4f500fcdefc105403a82ab49d0f35

See more details on using hashes here.

File details

Details for the file loctraceback-1.1.1-py3.7.egg.

File metadata

  • Download URL: loctraceback-1.1.1-py3.7.egg
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for loctraceback-1.1.1-py3.7.egg
Algorithm Hash digest
SHA256 101d4fdd8c00ebcdbb971a55f87fe92b53d4892322b071ebe9fd85e81c61e877
MD5 60b4f58f1751cf70bc07f78d28b6e50f
BLAKE2b-256 13f3cca12c9090bf73fd6b5b39e3d3f806ef7fdddac73b9f2f01ca5af007e6b1

See more details on using hashes here.

File details

Details for the file loctraceback-1.1.1-py3.6.egg.

File metadata

  • Download URL: loctraceback-1.1.1-py3.6.egg
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for loctraceback-1.1.1-py3.6.egg
Algorithm Hash digest
SHA256 c313f82db8514ab32667c5c44280ef25aad01d8947e3abc4e3c3179103f5964a
MD5 f4475e17532de1bb604a7a08fce39898
BLAKE2b-256 c4cc91420a8cc1f734db4039f585bca9ec8c36d7456a2e778ffbc9de2abc4011

See more details on using hashes here.

File details

Details for the file loctraceback-1.1.1-py3.5.egg.

File metadata

  • Download URL: loctraceback-1.1.1-py3.5.egg
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for loctraceback-1.1.1-py3.5.egg
Algorithm Hash digest
SHA256 4f5967a51933ebca97162cff67401d5f42cf7fb4abf0fa10686a8464034fcf96
MD5 bb9d62d73f4d00d7f14f7c33100e02b0
BLAKE2b-256 390ea48e2e7b7fe8bba91b9c25cfed15b789251ebe9f7bb6c0f4ffd753926c72

See more details on using hashes here.

File details

Details for the file loctraceback-1.1.1-py3.4.egg.

File metadata

  • Download URL: loctraceback-1.1.1-py3.4.egg
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for loctraceback-1.1.1-py3.4.egg
Algorithm Hash digest
SHA256 902c4e6ccaefa16833895638f6940da27cfa1c0e22f7eb717833294198d7f81e
MD5 fb017c6334aaddab840015a2248b4747
BLAKE2b-256 23c46506cae54c17dee21657f87be98b763a94720e4d545c5ee21275d05839e5

See more details on using hashes here.

File details

Details for the file loctraceback-1.1.1-py3.3.egg.

File metadata

  • Download URL: loctraceback-1.1.1-py3.3.egg
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for loctraceback-1.1.1-py3.3.egg
Algorithm Hash digest
SHA256 9d4c12e27aee7ea9f108e187ee83a899710a699ef1abaf82e674c600633cc039
MD5 6b29218b8d7365d28fc6f4245d45e116
BLAKE2b-256 9442a0ae7aa582f256a9f5ac38cb8803d906d62cae031c80d8ac34a0167e048b

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